AngularDart: ng-app optional? behavior when ng-app is missing?

Issue

In the tutorials that I have read so far, they all recommend putting ng-app as an attribute to the <body> tag, thus identifying that the entire body is part of the template managed by AngularDart. I was surprised to come across an AngularDart app without an ng-app attribute and yet it is still working. How is this?

Solution

The angular library ngBootstrap Dartdoc says that:

the root HTML element is used

When no ng-app attribute is present. (Fine print: note that ngBootstrap element and selector parameters can affect the choice of root element — but these parameters have not been used in the elementary examples I have seen so far. In any case, see the Dartdoc for the full details.)

Answered By – Patrice Chalin

Answer Checked By – Mary Flores (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.