Please enable JavaScript.
Coggle requires JavaScript to display documents.
AngularJs - Coggle Diagram
AngularJs
angular.module module is a container for the different parts of your app – controllers, services, filters, directives, etc
Controllers
$scope.on($viewContentLoaded, func(){}) ** Controller Lifecycle, when view is loaded
$scope.on($destroy, func(){}) ** Controller Lifecycle, when the view is destroyed
-
Filters
-
-
-
-
-
-
-
app.filter("filtername", function(){})
-
-
Service Types
-
-
factories
:pencil2: factories encapsulates some data and only returns what is necessary
:pencil2: factories explicitly returns an object to be consumed
services
:pencil2: same as factories services are embedded into modules
:pencil2: services are always singletons (only single instance)
:pencil2: services are mostly utilities or business logic units
:pencil2: services are kind of a constructors angularjs will instantiate services whenever required
-
providers
:star: Providers are the core methodology behind factories and services
:star: providers can be used when we need some kind of configuration in our business logic service
-
Custom Directives
:pencil2: Custom directives are markers on DOM Elements
:pencil2: CDs can transform the DOM elements and its children
:pencil2: AngularJS normalizes an element's tag and attribute name to determine which elements match which directives.
:star: restrict A,E,C,M
templateUrl, scope
When should I use an attribute versus an element? Use an element when you are creating a component that is in control of the template. The common case for this is when you are creating a Domain-Specific Language for parts of your template. Use an attribute when you are decorating an existing element with new functionality.
-
-
-
-
UI.Router
-
$stateProvider :star:
$stateProvider.state("name" {})
$urlRouterProvider :star:
$urlRouterProvider.otherwise() Redirect when no route is available
$stateParams
QueryParams url?a&b
URLParams url/:a/:b OR url/{a}/{b}
Regex: ur/{a:[0-9]+}/{b}
Array
ui-sref="routeName({json})"
$state Service
:check: Reload States
:check: Naviagate btw states dynamically
:check: Fetch state dynamically
-
-
-
-
A state can have multiple views
:check: Every 'state' config can have 'views' section
:check: Every view in "views' section can have its own template and controller and associated with single "ui-view"
:check: Multiple states can reuse ui-views