This is a draft cheat sheet. It is a work in progress and is not finished yet.
Module Setup
var app = angular.module('MyApp', []);
|
Controller Setup
app.controller('MainController', ['$scope', function($scope) { }]);
|
Core Directives
Attach a Module to HTML
<body ng-controller = "MyApp">
Attach a Controller to HTML
<div ng-controller="MainController">
Iterate through an array
<div ng-repeat="item in items">
|
|
|
Directive Template
app.directive('MyDirective', function() {
return {
restrict: 'E',
scope: {
info: '='
},
templateUrl: 'js/directives/myDirective.html'
};
});
|
|