Thursday, March 2, 2017

Angular JS

  • is a Javascript Framework
  • ng-app 
      • root element of Application (Tell HTML to use AngularJS)
  • ng-controller
      • Define Controler.
  • ng-model
      • Bind HTML Control value to App Data.
  • ng-bind
      • Bind App Data to HTML Control Value.
      • {{expression}} = output {{5+5}} = 10 
  • ng-int 
      • Initialize AngularJS app variable (JSON)
  • Service(AJAX) : $http
      •  Read Data from Server side(HTTP Request) / Text File
  •  $scope : parameter passed to the controller
      • Is Model Between Controller and Views
      • $scope.message & $scope.type is to display in HTML page.
  • Validate Data
      • $dirty : value has changed ?
      • $Invalid: value is Invalid ?
      • $error: State exact error.
  • Include
      • Embedding HTML Page
      • Can more than 1 in 1 HTML Page.
      •  For Code Reuse
      • Good For Header/ Footer/ Sidebar
  • ng-view
      • Partial Represent with controller and Route (Page's URL)
      • Only 1 per HTML Page.
      • Good For Content of the page.
      • and Change by URL (Category, PageNum, ID)
  • ng-template
      • Create an html view using Script Tag.
      • It contrain "id", and use &routeProvider to map a view with controller.
  • &routeProvider
      • Key configuration of URL map with HTML or ng-template


No comments:

Post a Comment