an angular.js directive that complements the $route service by including the rendered template of the current route into the main layout file.
Questions tagged [ng-view]
348 questions
132
votes
6 answers
AngularJS - Multiple ng-view in single template
I am building a dynamic web app by using AngularJS. Is it possible to have multiple ng-view on a single template?

Jayram
- 18,820
- 6
- 51
- 68
18
votes
1 answer
How to nest ng-view inside ng-include?
When trying to add an ng-view inside an ng-include, nothing happens. e.g. in the following code, when themes/midnight/index.html holds an ng-view, no view is rendered:
However, if I use…

ccoroom
- 699
- 9
- 23
16
votes
5 answers
Bootstrap data-spy="affix" not working on Angular View change
I'm trying to figure out why my affix-ed panel isn't staying put when I change my Angular view.
I've added the affix property directly to the panel on the first page (details), and left it in the data-spy only in the second page (flights).
In a full…

PGallagher
- 3,123
- 2
- 26
- 37
14
votes
2 answers
Angularjs routing not working
Everything worked fine until I tried to add routing. I read that Angularjs version 1.2+ requires 'ngRoute' as an dependency (I am using version 1.2.16). I added it but it still doesn't work. Below are my codes.
test.html (Main Page)

yellowbyte
- 189
- 1
- 2
- 13
14
votes
6 answers
Why will my twitter widget not render if i change the view in angularjs?
Hi and thanks for reading.
I have a angular app im making and ive stumbled on a problem. set up as so
index.html-
...
...
I wont bother putting my routes its…

Aidan Gee
- 578
- 1
- 11
- 26
12
votes
2 answers
ng-view not working on Microsoft Edge
I am testing my application on Microsoft Edge and it throws this error:
app.config(
function ($routeProvider) {
$routeProvider.
when('/logout', {
template: ' '
})
…

Le Dac Sy
- 381
- 3
- 16
9
votes
2 answers
Get headers when ng-view changes
All of our content pages have a particular header, X-Foo. When the content of the ng-view changes, we want to display the new page's X-Foo header in a different element. How can we get this value whenever the content changes?
EDIT: Since this was…

user1207177
- 577
- 3
- 16
6
votes
1 answer
Angular not updating ng-class on ng-view
I'm using angular 1.6.5 for my angular application and came across a very strange behavior.
The thing I want to achieve is: when ngroute is being changed, I must remove active class from current view, wait for leave animation to complete, then add…

gogachinchaladze
- 1,064
- 1
- 8
- 19
6
votes
3 answers
Loading Angular View
Whenever we load .html files serving some controller in angular.
Does angular makes an ajax call to retrive that html.
Like this piecec of code.
.state('home', {
url: '/',
templateUrl: '/Modules/Signin/signin.html',
…

Gyanesh Gouraw
- 1,991
- 4
- 23
- 31
6
votes
1 answer
Not sure when to use ng-view or ng-include
I have used recently the ng-view in partial view and it looks much like the use of ng-include. Is there a difference between the two: ng-view directive and ng-include or when is it better to use which?

Taiwotman
- 885
- 14
- 27
6
votes
2 answers
AngularJS App: Load data from JSON once and use it in several controllers
I'm working on a mobile app using AngularJS as a framework, currently I have a structure similar to this:
app.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/', {
templateUrl : 'pages/home.html',
…

Didier
- 63
- 1
- 4
6
votes
2 answers
AngularJS multiple templates in one page
I have an index that serves a static header menu, and below that an ng-view that based on route, selects the right template. Like this for example:
...
Everything is good so far, when a specific route is…

Rus Paul
- 1,348
- 2
- 14
- 23
6
votes
2 answers
Multiple ng-views for homepage in angularjs
Okay i am new to angular, just started working with ngRoute and ngView directives, i have come across something that is an issue for me but i suspect is only an issue due to my lack of expereince in angluar.
I have the following markup(simplified)…

user3718908x100
- 7,939
- 15
- 64
- 123
6
votes
2 answers
How to do multiple views with Angular to support header and sidebar?
I'm using AngularJS for the first time. I've successfully implemented a single ng-view in my index.html page which contains a header.html template. So it looks like below
But now I'm creating a dashboard (dashboard.html). So, I have a left side…

birdy
- 9,286
- 24
- 107
- 171
5
votes
1 answer
How to use regular javascript for code inside ng-view (angularjs)
First time using angularJS here. Basically, i used the routing service, so i have a with routing calling in a template with html code in it. I also have all these regular javascript functions that are required for the code in the template to…

goldensausage
- 229
- 1
- 2
- 11