angular.directive.ng:init
Description
ng:init
attribute allows the for initialization tasks to be executed
before the template enters execution mode during bootstrap.
Usage
In HTML Template Binding
<ANY ng:init="expression">
...
</ANY>
Parameters
- expression –
{expression}
– to eval.
Example
<div ng:init="greeting='Hello'; person='World'">
{{greeting}} {{person}}!
</div>
it('should check greeting', function(){
expect(binding('greeting')).toBe('Hello');
expect(binding('person')).toBe('World');
});