By Arslan Azeem · 3/27/2020
ng-app
directive in AngularJS.To get started with AngularJS, you need to fulfill two requirements:
Include the AngularJS script: Add a script tag pointing to the AngularJS library, which is the only core script needed for Angular features. This can be done by using platforms like Plunker.
Add the ng-app
directive: This directive is essential as it tells AngularJS to take control of a specific section of your HTML. You can place it on the <html>
or <body>
tag, but only one ng-app
directive is allowed per page. Angular will manage everything within the scope of this directive, as explained at timestamp.
After setting up AngularJS, you can test its functionality by using binding expressions. For example, you can perform calculations like 843 / 42 within double curly braces. This allows Angular to evaluate and display the result dynamically on your webpage, confirming that Angular is operational.
With just the script tag and the ng-app
directive, you can start building Angular applications. However, to create more complex features, further learning about AngularJS and its environment is necessary. Let's continue exploring Angular in the next segments!
11/25/2022
3/31/2025
3/27/2020
1/5/2022
4/10/2019
5/3/2016