Questions tagged [ng-app]

Use this directive to auto-bootstrap an AngularJS application. The ngApp directive designates the root element of the application and is typically placed near the root element of the page - e.g. on the

or tags.

Use this directive to auto-bootstrap an AngularJS application. The ngApp directive designates the root element of the application and is typically placed near the root element of the page - e.g. on the or tags.

Only one AngularJS application can be auto-bootstrapped per HTML document. The first ngApp found in the document will be used to define the root element to auto-bootstrap as an application. To run multiple applications in an HTML document you must manually bootstrap them using angular.bootstrap instead. AngularJS applications cannot be nested within each other.

You can specify an AngularJS module to be used as the root module for the application. This module will be loaded into the $injector when the application is bootstrapped. It should contain the application code needed or have dependencies on other modules that will contain the code. See angular.module for more information.

In the example below if the ngApp directive were not placed on the html element then the document would not be compiled, the AppController would not be instantiated and the {{ a+b }} would not be resolved to 3.

ngApp is the easiest, and most common way to bootstrap an application.

61 questions
0
votes
0 answers

Updation of a shared object that is created inside factory method of a module is not updating in another module in Angular JS

Hello I am a beginner in Angular JS and now I am stuck into something. I have made two modules Menu and Canvas Now I have declared a object inside the factory method of Menu module to make it available from Canvas module. My code is as follow; var…
KOUSIK MANDAL
  • 2,002
  • 1
  • 21
  • 46
0
votes
1 answer

How to use ng-app and ng-controller for many pages?

I'm stuck in CRUD Operations in AngularJS. index.html. on this page on body I am using ng-app and ng-controller. offer_letter_dashboard.php and termination_dashboard.php on this page I am writing script for adding and fetching data. I am using…
mahadev sutar
  • 171
  • 2
  • 16
0
votes
1 answer

Angular Js routing not working properly when file separated

//this is the app.js go down below to see controller.js angular.module('myFirstApp',['ngRoute']) .config(function($routeProvider){ $routeProvider.when('/contact',{ templateURL : 'contact.html' }) …
0
votes
1 answer

Trouble declaring and linking a controller together in my app

Link to Github So I have 3 files. There is a source folder which contains my app.js file and also contains folder called Sheets_API_Quickstart, which contains quickstart.js, and a folder called Project, which contains Waiting_List.html I attempted…
Ryan
  • 262
  • 3
  • 19
0
votes
1 answer

AngularJS controllers not showing data when ng-app not adjacent

New Angular JS coder, minor issue. Defining this:
and then