- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2015 11:58 AM
Has anyone successfully used routing within an Angular UI? I'm working with a BootStrap navbar, and trying to define content using routing (ng_route). Having a little trouble, but before I spend too much time with this approach, wanted to checkin to see if this is even possible within ServiceNow.
Thanks in advance for any advice/direction!
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2015 07:36 AM
Hi Mitch,
It is definitely possible. The best approach I have found is to use a processor to handle the views because UI Pages and other endpoints add text to any template you would send through. So your ng-route when statement will point the templateUrl to the processor. The processor will then return the view html template. Please feel free to ask any questions on this.
Kind regards,
Travis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2015 07:36 AM
Hi Mitch,
It is definitely possible. The best approach I have found is to use a processor to handle the views because UI Pages and other endpoints add text to any template you would send through. So your ng-route when statement will point the templateUrl to the processor. The processor will then return the view html template. Please feel free to ask any questions on this.
Kind regards,
Travis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2015 07:43 AM
Thanks Travis...I'll work on that approach this afternoon. Are there CORS issues to address, that you have found? I saw a post somewhere yesterday (can't find it now) that referenced using localhost somewhere in the config. I'm working in a developer instance at the moment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2015 08:15 AM
I have not found any CORS issues but I have never used anything regarding localhost, except when running an AngularJS site locally and not on the ServiceNow platform. When using it on the ServiceNow platform, all my URL's pointed to the same origin, my ServiceNow instance URL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2015 10:02 AM
Let me present a conceptual question...
I'm starting with a NavBar that basically presents 3 different process paths related to access management (request, status, and administration) from the application dashboard. For design logic, it makes sense to me to split these out with separate controllers, etc.
So my question is: Is routing the best approach or do you think I'd be better served using UI Macros for the separate UI pages (paths)? Or is there something else to consider?