The section and tree is rendered correctly and when I click create the create.html is loaded from 'App_Plugins/CustomData/Reports/create.html'. So far so good
But in the create.html I have a couple of options: <a href="#/CustomData/Reports/edit/?create=true" ng-click="nav.hideNavigation()">New datatable</a> <a href="#/CustomData/Reports/import" ng-click="nav.hideNavigation()">Import datatable</a>
When clicking these links angularjs is looking for views in 'Umbraco/Views/Reports/'
I'm guessing my urls in create.html are wrong. How can I make angularjs look in the app_plugins folder? What are the correct url's that I can use in my views?
Angularjs routing in custom section
I've created a custom section and have a custom tree like this:
[Tree("CustomData", "Reports", "DataTable", iconClosed: "icon-doc")]
[PluginController("CustomData")]
The section and tree is rendered correctly and when I click create the create.html is loaded from 'App_Plugins/CustomData/Reports/create.html'. So far so good
But in the create.html I have a couple of options:
<a href="#/CustomData/Reports/edit/?create=true" ng-click="nav.hideNavigation()">New datatable</a>
<a href="#/CustomData/Reports/import" ng-click="nav.hideNavigation()">Import datatable</a>
When clicking these links angularjs is looking for views in 'Umbraco/Views/Reports/'
I'm guessing my urls in create.html are wrong. How can I make angularjs look in the app_plugins folder? What are the correct url's that I can use in my views?
Stig
Hello,
This topic is also about AngularJS and routing: http://our.umbraco.org/forum/umbraco-7/using-umbraco-7/48392-Custom-Dashboard-(UkFest-AngularJS-Demo)
Maybe it can help.
Jeroen
Hi Stig,
I had the same problem, here is the solution i found:
I created a function on the controller that looks like this (i change my parameters for yours):
$scope.goto = function (loc,nav) {
$location.path("loc");
nav.hideNavigation();
};
and you will need to change your <a> to this:
<a href="#" ng-click="goto("/CustomData/Reports/edit/?create=true",nav)">New datatable</a>
That will redirect you to your edit.html in your reports section
Don't forget to add $scope and $location to your controller
is working on a reply...