I finally figured this out (sort of). I wasn't able to have the directory structure I wanted (which is similar to the one outlined in the post), but I am at least able to go to edit page. I'm not sure if it will satisfy your case unless you have a TreeController (with a Tree attribute and PluginController atrribute with the name of the folder I put my pieces in) in your workflow.
On my TreeController, I set the RoutePath to SectionAlias/TreeAlias/overview for when you click on the node in the tree, which always worked fine.
This resulted in loading my overview.html in App_Plugins/PluginControllerAttributeName/backoffice/TreeAlias folder.
From there I was able to navigate to my edit.html if I put it in the same TreeAlias folder that contained my overview.html.
It's as if the Tree established my backoffice route properly, and only things living under that route can be browsed to. I even tried registering a child node to the tree with a custom RoutePath, but it didn't work either.
This works fine for me, and I will register other custom routes for other trees, and then follow the same pattern. I hope this helps in some way.
1) Move all the routing into the main app.config, and remove the duplicate route for /home.
2) change this line
var flightformsControllers = angular.module('flightformsController', []);
to
var flightforms = angular.module('flightforms', []);
3) change the app definition line to inject the flightforms module:
var app= angular.module('myApp', ['ngRoute', 'flightforms']);
That should get ya close.
For one of your comments, its a good idea to have an interecptor which catches any 401 un-authenticated errors from the server. This way, if a user's session expires before a route change, they will still have to login again to start a new session. Something like this in app.config should do it.
How to use Angular route in backoffice
Hi guys, I created a custom dashboard called 'Dealer' to display dealer information.I want to edit them with my own view.My directory structure is:
I want to click on the link in the Dealer.html page to go to page edit.html. I try
But it don't work, return error :Request error: The URL returned a 404 (not found): views/editor.html.
What should I do to specify the position of the view?
I am trying to do the same exact thing in v8, and have been struggling for days. Anyone out there have an answer to this?
You can try:
dealerListAlias is view alias. edit is view name. dealer_111 is route parameter.
I finally figured this out (sort of). I wasn't able to have the directory structure I wanted (which is similar to the one outlined in the post), but I am at least able to go to edit page. I'm not sure if it will satisfy your case unless you have a TreeController (with a Tree attribute and PluginController atrribute with the name of the folder I put my pieces in) in your workflow.
It's as if the Tree established my backoffice route properly, and only things living under that route can be browsed to. I even tried registering a child node to the tree with a custom RoutePath, but it didn't work either.
This works fine for me, and I will register other custom routes for other trees, and then follow the same pattern. I hope this helps in some way.
1) Move all the routing into the main app.config, and remove the duplicate route for /home.
2) change this line
var flightformsControllers = angular.module('flightformsController', []); to
var flightforms = angular.module('flightforms', []); 3) change the app definition line to inject the flightforms module:
var app= angular.module('myApp', ['ngRoute', 'flightforms']); That should get ya close.
For one of your comments, its a good idea to have an interecptor which catches any 401 un-authenticated errors from the server. This way, if a user's session expires before a route change, they will still have to login again to start a new session. Something like this in app.config should do it.
$provide.factory('logoutOn401', ['$q', '$injector', function ($q, $injector) { return { 'responseError': function(response) { if (response.status === 401) { $location.path('/login') return $q.reject(); } else { return $q.reject(response); } } }; }]);
$httpProvider.interceptors.push('logoutOn401');
njmcdirect
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.