Supported by Google No need to learn another scripting language Its just pure

Supported by google no need to learn another

This preview shows page 8 - 14 out of 31 pages.

Supported by Google No need to learn another scripting language. It's just pure JavaScript and HTML. Supports separation of concerns by using MVC design pattern. Built-in attributes (directives) makes HTML dynamic. Easy to extend and customize. Supports Single Page Application. Uses Dependency Injection. Easy to Unit test. REST friendly.
Image of page 8
AngularJS Development Environment 9 The following tools to setup a development environment for AngularJS: 1. AngularJS Library 1. To download AngularJS library, go to angularjs.org 2. CDN: You can include AngularJS library from CDN url - 6/angular.min.js 2. Editor/IDE 3. Browser 4. Web server
Image of page 9
AngularJS components 10
Image of page 10
AngularJS components 11 Module : Modules serve as containers to help you organize code within your AngularJS application. Modules can contain sub-modules, making it easy to compose functionality as needed. Config The config block of an AngularJS application allows for configuration to be applied before the application actually runs. This is useful for setting up routes, dynamically configuring services, and so on. Routes Routes allow you to define ways to navigate to specific states within your application. They also allow you to define configuration options for each specific route, such as which template and controller to use. Views The view in AngularJS is what exists after AngularJS has compiled and rendered the DOM with all of the JavaScript wiring in place.
Image of page 11
AngularJS components 12 $scope $scope is essentially the glue between the view and controller within an AngularJS application. With the introduction of the controller-as syntax, the need to explicitly use $scope has been greatly reduced. Controller The controller is responsible for defining methods and properties that the view can bind to and interact with. As a matter of best practice, controllers should be lightweight and only focus on the view they’re controlling. Directive A directive is an extension of a view in AngularJS in that it allows you to create custom, reusable elements that encapsulate behavior. You can think of directives as components or decorators for your HTML. Directives are used to extend views and to make these extensions available for use in more than one place. Service Services provide common functionality to an AngularJS application. For instance, if you have data that more than one controller needs, you would promote that data to a service and then make it available to the controllers via the service. Services extend controllers and make them more globally accessible
Image of page 12
MVC in AngularJS 13 AngularJS designs the applications in MVC style. MVC is an important concept of this technology, hence it is imperative to have familiarity with it. MVC stands for Model View Controller. Let’s find out what is it: Model – A model in AngularJS is a primitive data type such as number, string, boolean, object, etc. It is a simple JavaScript object without any getter and setter methods.
Image of page 13
Image of page 14

You've reached the end of your free preview.

Want to read all 31 pages?

  • Winter '18
  • Anil Sir
  • Document Object Model, AngularJS,  AngularJS

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture