Fichas
angularjs
Fichas del conjunto (20)
- 1DirectiveA Directive is a marker on a HTML tag that tells Angular to run or reference
some JavaScript code - 2Modules• Where we write pieces of our Angular application.
• Makes our code more maintainable, testable, and readable.
• Where we define dependencies for our app.
Modules can use other Modules.. - 3Creating Our First Modulevar app = angular.module('store', [ ]);
- 4Including Our ModuleRun this module when
the document loads. - 5ExpressionsI am {{4 + 6}}
- 6Attaching the Controller
- 7controllerapp.controller('StoreController', function(){
this.product = gem;
}); - 8NgShow Directiveng-show="store.product.canPurchase"
Will only show the element if the
value of the Expression is true - 9NgHide Directiveng-hide="store.product.soldOut"
Will only hide the element if the
value of the Expression is true - 10ng-repeat Directive{{product.name}}
${{product.price}} - 11Filter{{ data | filter:options }}
{{'My Description' | limitTo:8}} - 12ng-src
- 13ng-clickAssigning a value to tab
Expressions define a 2-way Data Binding ...
this means Expressions are re-evaluated when a property changes - 14ng-initng-init allows us to evaluate an expression in the current scope
- 15ng-classng-class="{ active:tab === 3 }"
Expression to evaluate
If true, set class to “active”,
otherwise nothing. - 16ng-modelng-model="review.stars"
ng-model binds the
form element value
to the property - 17ng-submitng-submit="reviewCtrl.addReview(product)"
ng-submit allows us to call a function when the form is submitted - 18ng-includeng-include="'product-title.html'"
ng-include is expecting a variable with the name of the file to inclu
To pass the name directly as a string, use single quotes ('...') - 19Custom Directivedefine a custom tag or attribute that is expanded or replaced
can include Controller logic, if needed - 20Reviewing our DirectiveAn Attribute Directive
An Element Directive
Información
- Descripción
- Fichas sobre angularjs, creado por Jaabiri Slim el 15/09/2015.
- Creado por
- Jaabiri Slim
- Visitas
- 5
- Valoración