Skip to content

Instantly share code, notes, and snippets.

@gladiatorAsh
Last active November 22, 2018 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gladiatorAsh/898e9c4bc4d179735066905dce60cce6 to your computer and use it in GitHub Desktop.
Save gladiatorAsh/898e9c4bc4d179735066905dce60cce6 to your computer and use it in GitHub Desktop.
Revision of Angular
  1. Directives are HTML attribute modifiers
  2. Expressions bind data to HTML
  3. Filters format data and coincidentally also filter
  4. Modules define Angular JS applications
  5. Controllers control AngularJS applications
  • ng-app directive: Initiates an angular js application
  • ng-model directive: binds value of HTML controls to app data
  • ng-bind directive: binds app data to HTML elements
  • ng-init directive: inits Angular JS
  • ng-repeat directive: bind elements to array of objects
  • ng-show are used to display messages like errors on page
  • ng-app are used to define the application
  • ng-controller are used to define the controller
  • ng-disabled
  • ng-show
  • ng-hide

Custom directives: `

      app.directive("w3testdirective",function(){
          return{
              restrict:"A",
              template:"<h1>Made in USA</h1>"
          }
      });
      `

Custom filters: Make uppercase

Angular Services - $location - $http - $timeout - $interval

ng-options vs ng-repeat? Which to use?

Angular Events - ng-blur - ng-change - ng-click - ng-dblclick - ng-focus - ng-keydown - ng-paste

Angular validation - $untouched - $pristine - $dirty - $invalid - $valid - $submitted

You can have custom directives for validation

Angular JS Global API - angular.lowercase() - angular.uppercase() - angular.isString() - angular.isNumber()

Angular Animations: Generally done by switching CSS classes - ng-if - ng-switch

Angular Routing: - ng-route - ng-view

Interfaces in Angular Decorators Services Templates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment