Giter Club home page Giter Club logo

classangular's Introduction

Angular JS Class

Angular JS Class Notes:

Controllers

Contorller are use to setup the initial $scope of object & behevior of object.

Assigs the value to variable(property).

Do not use controlles for:

  1. Manipulating the Dom. a. Contorller should contain only application (busisness) logic. b. Putiing any presentation logic in cotroller affects its testability c. Angular Js had data bindings & directives for DOM manipulation.
  2. Formatting input a. Angular has form controlls for formattting inputs
  3. Filtering output a. Angular JS had filters for fitering output
  4. Share code / state across controllers (Service) a. Angular JS had services to share the code / state across controllers
  5. Manage life cycle of other components a. Angular JS does it internally.(Angular JS intialize internally othe componets)

Scope Inheritence

$scope variable are shared to the nested controllers this variable ate not shared to the nested controllers

Service

Custom componets include as service. All are intianted by Angular by default

  1. Service as Service (Private set of function)
  2. Factory as Service (Private set of Object)
  3. Provider as Service (Angular uses internally)

a. app.run - one time execute code b. app.config - define the route, Provider inject in app.config (ex RouteProvider) ex: http http.get http.post

Some service retuns the functions or objects. Service we need just defined & that will called with inculde. Service always retunrns the functionality.

  1. Angular Services are substute . that are wired together using dependency injections.
  2. Services are used to organized & share code across the appp
  3. Angular Service are a. lessyly intitinal (when it is injected or component depends on it[cotroller directiv]) b. Singleton - each componant refer is single refrence of the service.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.