I would like to create master page, that is main page which will be used in all views of the application.
For example, Left navigation and top men navigation. This navigation should be displayed in all the views, whenever url changes in application.
As per ng-view, it only renders given partial view and replace previous view. In the image above all my left and top navigation should be displayed by using angular Controller.
Controller code
angular.module('modelDemo').controller("authCtrl", ['$scope', function($scope) {
$scope.list;
}]);
Please let me know, how can i achieve this
Solution. My career in web development started with ASP.NET which has the concept of master pages: a page that defines the layout of the web application and has placeholders for the content. The actual pages defined components that live in those placeholders.
Extending an AngularJS Workflow¶ A workflow extends the extensibleService . This means that all workflows inherit properties and methods provided by the extensibleService . Extending a workflow allows you to add your own steps, remove existing steps, and inject custom data handling logic.
The $ in AngularJs is a built-in object.It contains application data and methods.
Templates in AngularJS are simply an HTML file filled or enriched with AngularJS stuff like attributes and directives. A directive is a marker element that is used to target a particular attribute or class to render its behavior as according to the needs.
You can use angular-route or Angular-ui-router, and setting your master, following this steps:
index.html
your master page. <header>
, <footer>
, <aside>
, <div>
, etc. referencing your templates by using ng-include
ng-view
or ui-view
app.config()
to configure the children pagesSource:
ng view should be able to do that just fine. Keep your top navigation / left navigation html intact and use ng view for the various display area. http://docs.angularjs.org/api/ng.directive:ngView
To use the controller from the top navigation inside ng-view you can use $parent to get access to that scope : https://stackoverflow.com/a/14700326/390330
Fiddle for parent scope : http://jsfiddle.net/ezhrw/2/
<button ng:click="$parent.letter = greek">Assignment expression {{ greek }}</button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With