Skip to content

Instantly share code, notes, and snippets.

@sugavaneshb
Last active April 23, 2016 07:13
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 sugavaneshb/2aa11ae51edce9f878212d4ee6056cbb to your computer and use it in GitHub Desktop.
Save sugavaneshb/2aa11ae51edce9f878212d4ee6056cbb to your computer and use it in GitHub Desktop.
Basic modules in AngularJS. This was created by me long ago when I started on AngularJS. Cleaning up my notes and organizing them in a single place

AngularJS

Directive

Its a marker on a html tag that tells Angular to run or reference some javascript code. This is used to bind the behavior. These are HTML annotation that triggers javascript behaviors.

eg:

<body ng-controller="StoreController">
....
</body>

function StoreController() {
}

Modules

Mini - components and separation of concerns inside an application.

<html ng-app="store"> </html>

var app = angular.module("store", []);

Expressions

Allows you to insert dynamic values into HTML. Decides how data gets displayed on website.

<p>{{ data }} </p>

Controllers

Application behavior is added here.

app.controler("controllerName", function(){});

Filters

Allows to format the output.

<p> {{ data | filter:options }} </p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment