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
1
vote
3 answers

How to use same ng-app for 2 different html page?

I have 2 html page and one app.js my search-movie.html code as the following : Search Movie
eagle
  • 451
  • 1
  • 7
  • 27
1
vote
2 answers

How to fix "Uncaught Error: [$injector:modulerr]" error?

I am trying with angularjs but I get this error : Uncaught Error: [$injector:modulerr] This is my html code : Search Movie
eagle
  • 451
  • 1
  • 7
  • 27
1
vote
1 answer

how to inject an html element with angular directives using jquery?

I want to inject one HTML element which has been announced with angular directives. With jquery. but the application is not working. test angular
1
vote
4 answers

Angular JS: unable to display value

I am a new learner of Angular JS. Please help me to find reason why this demo only display : {{name}} instead of showing each values, AngularJS Demos
Dan
  • 2,086
  • 11
  • 71
  • 137
1
vote
0 answers

Angular JS - the common issue of two apps using the same route provider

Hey all and thanks for reading. I have a client side set of text blurb I wanted to feed through views using ng. My problem is that although I feel I have this set up correctly, I only ever see a repetition of the first view on the second view and…
gruffy321
  • 175
  • 2
  • 13
1
vote
2 answers

Angular in an XML Namespace does not auto bootstrap via ng:app

I know that due to backwards compatibility with IE, Angular allows the use of an xmlns and using ng: instead of ng-, however it doesn't appear to be working with all directives in xhtml
1
vote
0 answers

Error: Protractor ng-app no injector for element argument found - set rootElement doesn't solve it

I'm currently writing end-to-end-tests using protractor. With the selenium standalone server I'd like to run them on different browsers (on a win10-vm). Chrome works perfectly fine, but firefox constantly throws the following error: Failed: Error…
MH_
  • 11
  • 2
0
votes
1 answer

How can I add weeks to current date and return a result in the form field?

I am using the following code to display the date in a form. In the form I have a field titled "Duration" being weekly rental eg 3 weeks, 5 weeks etc.. I would like the "Return Date" do display the date "X" number of weeks from the date the form is…
0
votes
1 answer

How to add values from an Object Attributes and display them in AngularJS

I'm writing an application where it allows you to add and remove books. It calculates the total value of the book per row. I'm trying to add up all the prices within the $scope.books.price, but i can't seem to wrap my head around how to write the…
0
votes
1 answer

Modifying body tag in Oracle

Is there a way to edit the tag in Apex 4.1 and make it display the following: ??
matt1966
  • 1
  • 3
0
votes
2 answers

The controller with the name 'viewctrl' is not registered

0
votes
1 answer

How to use multiple ng-app and add new modal

Here is my todo.js file //let example = angular.module("example", ["ngStorage"]); example.controller("ExampleController", function($scope, $localStorage) { $scope.save = function() { let testObject = [ { …
0
votes
2 answers

resolve the following error Uncaught Error: [$injector:modulerr]

I am very dificulty to resolve the following error in my applications client-side using AngularJS: enter image description here Any help or advice would be appreciated. Thanks
J. Moura
  • 27
  • 7
0
votes
1 answer

Angular project, ng-app directive only found in vendor.bundle.js.map

I've been given an Angular project that I am trying to understand. For now I am able to start the project with the command "gulp serve" and then I can browse to the development server from Chrome with "http://localhost:3000". When I search for all…
user10686877
0
votes
3 answers

I want to use two angularjs modules/app in the same web page

I created two angular modules (navigation and translation) saved into two different files, and I want to use at the same time in my index.php . What I understand is that I can run only one module/app per html page. (Both app are running perfectly…
user6901390