Questions tagged [angularjs-view]

ngView is a directive that complements the $route service by including the rendered template of the current route into the main layout (index.html) file. Every time the current route changes, the included view changes with it according to the configuration of the $route service.

Overview
ngView is a directive that complements the $route service by including the rendered template of the current route into the main layout (index.html) file. Every time the current route changes, the included view changes with it according to the configuration of the $route service.

Directive Info
- This directive creates new scope.
- This directive executes at priority level 400.

Usage

as element: (This directive can be used as custom element, but be aware of IE restrictions).

<ng-view
  [onload=""]
  [autoscroll=""]>
...
</ng-view>

as attribute:

<ANY
  [onload=""]
  [autoscroll=""]>
...
</ANY>

as CSS class:

<ANY class="[onload: ;] [autoscroll: ;]"> ... </ANY>
52 questions
6
votes
1 answer

Change only one view on state change in ui.router?

I have a simple layout like so: __________________ ________ | | | Side | | Main section | | -bar | |________________| |______| The "Main section" exposes forms to the user; based on their selection that "Main section" state…
A T
  • 13,008
  • 21
  • 97
  • 158
6
votes
2 answers

Why ng-scope is added to javascript inline of my partial view and makes alert not working?

I'm using AngularJs with templating system. I want to add specific inline javascript script to each template adding alert box regards to the selected tab ( Home | List | Settings ) Html renders : but ng-scope is added and nothing alerts when you…
Julien DES
  • 113
  • 1
  • 8
4
votes
1 answer

"AngularJS way" to map values for output in a view

Am seeking advice on a beginner problem with AngularJS: My app has lots of cases where the API it's working with gives a value from a list of possible types, I've pulled the value into my model and then I want to map it to something, eg icons for…
Neil
  • 686
  • 1
  • 9
  • 27
4
votes
3 answers

How to prevent view redraw when changing route in AngularJS

I'm making a web app where users can view objects on a map, press a marker and go to a new view with information. From that view they can traverse deeper, into more information. Something…
PerMafrost
  • 509
  • 3
  • 18
3
votes
1 answer

Switching Angular view not updating variables

I'm just building out a simple app to learn AngularJS and having trouble updating variables when switching views. Here's what I have so far: function routeConfig($stateProvider, $urlRouterProvider) { $stateProvider .state('home', { url: '/', …
Nam Nguyen
  • 51
  • 7
3
votes
3 answers

Losing form input data when reinvoking a controller

I have a simple multi-view Angular application that implements a wizard, so each time a user clicks "Next" button, the app navigates to the next view, and same for "Back" button. I have a $routeProvider config that binds all views to the same…
3
votes
1 answer

Controlling multiple views in one controller in AngularJS

Following the MVC pattern, one controller should be able to handle multiple views in AngularJS. E.g. I have one view for showing all users and one for creating a new user. My $routeProvider (excerpt) looks like…
Horen
  • 11,184
  • 11
  • 71
  • 113
3
votes
1 answer

Is there a way to render a view outside of ng-view only when ng-view gets rendered?

I've got user navigation in a partial loaded using ng-include that's outside of the ng-view. I'm also authenticating users and prefetching almost all data necessary for any controller and view in route.resolve. The issue is that the user navigation…
szimek
  • 6,404
  • 5
  • 32
  • 36
2
votes
1 answer

AngularJS view without controller

I creating a simple angularjs app. I've imported ngRoute module and 2 views - Home and Contact. Home view is defined with controller. .when("/", { templateUrl: "home/home.html", controller: "HomeController" }) I don't need to implement…
Zaprogramowany
  • 623
  • 1
  • 7
  • 10
2
votes
1 answer

Different animation when history.back() ist used

I've created a website based on AngularJS. Every page has it's own template and controller and is included via ng-view in the main layout. But I have a problem with animations between different pages. I want them to fly in from the right (and to…
Christopher
  • 2,005
  • 3
  • 24
  • 50
2
votes
2 answers

Which event fires when view is rendered in AngularJS?

I know there's $viewContentLoaded, but it fires before AngularJS substitutes the placeholders with scope variables. I managed to solve this by setting a timeout for 0 ms in my $viewContentLoaded listener, but that's very ugly. I'm using this to…
sevcsik
  • 1,210
  • 12
  • 12
2
votes
1 answer

Animating view navigation forwards and backwards

So, Angular 1.2 has full ng-animate support, and I've been using it for page transitions - initial setup was easy enough, awesome. Forward animations (left-to-right), no problem. Backwards navigation? Issues. In theory it just works: see…
cthulhu
  • 3,142
  • 2
  • 23
  • 32
2
votes
2 answers

How do I format data in a view in AngularJS?

is in my view. user.User.DateOfBirth is currently in YYYYMMDD format, but I want it to show as mm/dd/yyyy format in the view. Is it possible to convert this just for the display?
Shamoon
  • 41,293
  • 91
  • 306
  • 570
1
vote
4 answers

Share Variable between controllers of different routes - AngularJS

I'm new on Angularjs and I'm trying to build my first application. Let's say I have to routes that loads two different views: 127.0.0.1:8080/site 127.0.0.1:8080/site_details Maybe having two different routes is not the right procedure but that it…
1
vote
1 answer

How to display data retrieved from Firebase to AngularJS App

I have an angular application that is receiving data from firebase but I don't know how to display the data in the view. The data retrieved from firebase is an Object having 3 Objects with these names:…
1
2 3 4