service portal, angular, ng-animate, ng-view

scottl
Kilo Sage

What I'm trying to do is animate between pages with a sliding effect or even between widgets.   I've tried including it into the theme and even as a "dependancy", no luck.   Clicking "include on page load" within the widget dependancy, crashes the page also.     Has anyone successfully implemented this into their portal?   If so how was it done as it seems we do not have access to add to the original app creation method to include this dependancy onto the page, nor add "ng-view" to the page container?

8 REPLIES 8

Ivano B
ServiceNow Employee
ServiceNow Employee

Hi Scott



I had the same problem trying to include angular animate.


Inspecting I've noticed that the system was looking for a different name compare with the one i was using in the dependency script.


It has been enough to had a look to the library I was using where the module is named ngAnimate and use that name.


Unfortunately the system was still triggering another error making the page to crash.


Looking on the internet it seemed that similar issue are caused by the version of the library.


Just out of curiosity i started trying different angular-animate versions...i had no crash with v1.2.7 or older.


The problem anyway is still there because even if the page is rendered the animate library causes other issues in the background.


It seems that the system is unable to read a lot of property (e.g container, page, ng-scope etc etc)



nathanfirth fschuster - Guys I know that you are very well versed in Service Portal...do you mind to have a look ?


ctomasi ..including Chuck as well, maybe he can bring some help from ServiceNow as well ?



Kind Regards


R0bo


You mentioned the name... did you ensure the name in your dependency matches the app's module name? These have to match.



find_real_file.png



Sometimes it's in the API docs and sometimes you have to look in the JS you dumped in your script include.


tree.png


Ivano B
ServiceNow Employee
ServiceNow Employee

Hi Chuck



Thank you for your answer. I already did it. As mentioned in my initial post.


I've already solved that one. On the other hand it seems that now there is another issue.


The page is rendered but the module shows a lot of issues all related with the fact that specific properties (e.g. container, page etc) can't be read.



Just another quick question. Do you know what the angular version used by serviceNow is ?



Cheers


R0b0


ServiceNow is using AngularJS 1.5. You can always verify this by going to stats.do


find_real_file.png


Click the "Open Source Software" link at the top section.


find_real_file.png



In the PDF, you'll find the version.



find_real_file.png



FWIW, I found best results when testing on the actual rendered page, not preview from the designer or from the preview on the widget.