It's good that I'm new to angular, I just started working with the ngRoute and ngView directives, I came across something that is a problem for me, but I suspect that this is only a problem due to my lack of experience in angluar.
I have the following markup (simplified) in my index.html page:
<html> <head> <title>Sample APP</title> </head> <body> <div class="header"> <nav class="pull-right">...</nav> </div> <div class="main" ng-view> </div> <div class="footer"> </div> </body> </html>
The above default layout structure used by my page. Now my problem concerns only the home page, the slider is shown in a div with the class "header". Like this:
<div class="header"> <nav class="pull-right">...</nav> <div class="slider">...</div> <div>
Now this is only for the main page, so I am completely confused about how to implement this. Do I need two ng-view directives on my index page? eg:
<html> <head> <title>Sample APP</title> </head> <body> <div class="header"> <nav class="pull-right">...</nav> <div class="slider" ng-view>...</div> </div> <div class="main" ng-view> </div> <div class="footer"> </div> </body> </html>
Also, if you need to know why I do it this way, itโs just because I bought the html template online, now I am trying to integrate angularjs into the template.
source share