I am new in angularjs. I am developing a small webapp in angularjs. I use ui-router to route pages. I also have a landing page which is just static stuff with clickable links. The landing page covers the entire page, while other pages cover only "ui-view" div. I do not know if it's feasible what I am about to ask. Is it possible to use AngularJS (ui-router) to render the landing page (full html page) and other pages (partials), if so how, if not, is there a workaround? how to people usually add landing page to their angularjs app.
-
You cannot render the entire page, doing that is equivalent to a full reload. With ui-router, is easy do what you want, you only need to add this: .state('myRoute', { url: '/', templateUrl: 'views/myView.html' })manuerumx– manuerumx2016-10-10 21:45:27 +00:00Commented Oct 10, 2016 at 21:45
-
Study the demos...should answer your questionscharlietfl– charlietfl2016-10-10 22:03:41 +00:00Commented Oct 10, 2016 at 22:03
Add a comment
|
1 Answer
Since you are a beginner you will get such doubts..
Your index page should contain all the parts which should not change after routing to a different page.It can include navbar, footer, sidebar etc.
Whatever has to change should be put in ng-view.And I would recommend you to put your landing page also in a seperate file and route it at starting..
I have made a working template...have a look