You are on page 1of 3

Angular Cheat Doc

Angular Event Reg


Controllers responsibility to create scope.
Controllers Scope > View
Ng-App is used to define the modules in Ur shell page under html tag.
<html lang=en ng-app=eventsApp>
In app.js var eventsApp = angular.module(eventsApp, []);
eventsApp is the module which will run the this SPA.
<div ng-controller=testController>
One view can be managed with multiple controllers.
Controller Signature:
use strict
eventsApp.controller(testController,
function TestController($scope){ //controller created under module eventsApp
and it created an empty scope which will be filled by data using service and
return it to the view.});
Ng-src delays the requesting of an image otherwise as soon as html loaded it
will look for the image at the URL and it will return 404 not found.
Ng-click Click Event
Ng-submit to use required attribute
Ng-repeat ng-repeat = name in employees //loop through objects
Filters separated by pipe to apply format
Use single quote in ng-repeat for order by+ means asc , - means desc

Dynamic order by adding select option with same property using in ng-repeat.

Ng-show show using Boolean


Ng-hideto hide using boolean

Design Pattern:
Factory Pattern: Creational Pattern: Implement Interface to decouple and create
the object using user input or some logic. Use interface to return the client
object.

Abstract Factory Pattern: To Consolidate too many factory patterns. Create one
abstract class and let all the individual factories inheriting from this abstract
class. Implementation will be the same using interface.

Builder Pattern: Creational: Separate the construction process from


representation.
Tea Creation, Report Creation
Builder: All main action classes
Director: Implement the sequence
Product: Final client code

You might also like