<input type="checkbox" name="option1" value="a1" checked>
<input type="checkbox" ng-model="myModel">
name/id/class
can be omitted, because directives are not bound by name. The initial state is set by the model, so checked
does not make sense. But that is not all. The last code can be rewritten and so <input type="checkbox" ng-model="myModel" ng-true-value="on" ng-false-value="off" ng-change="change()">
on
or emptiness, and not true
and false
, why you can only change the value on
and many others. <ANY ng-repeat="book in books">
<my-dir></my-dir> <span my-dir="exp"></span> <span class="my-dir: exp;"></span> <!-- directive: my-dir exp -->
<td>
in the <tr>
. Also, for better compatibility with older browsers, it is recommended to start the directive name with a prefix (for example, my-). For validators, you can add prefixes x- or data- to names (they will be rejected by Angular).ng-cloak
directive, which hides the pattern until it is fully processed by Angulyar, and also use ng-bind
instead of the expression in curly brackets {{ }}
. // $scope.param1 = 'hello'; $scope.param2 = 'world'; // $scope.model = { param1: 'hello', param2: 'world' };
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }} ). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }} ). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }} ). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }} ). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }} ). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }} ). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }} ). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }} ). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }} ). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }} ). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }} ). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }}
). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }}
). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }}
). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }}
). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
: , - .
, .. , . . . .
, , , ( ). , .
- GZIP- ( ) index.html, .. , , . ( ): , , , CSS.
( ), . .
, :
, , ( , {{ }}
). .
$watch
{{ }}
. , , , .
ng-view
ng-include
DOM- , , ng-show
ng-hide
. ng-repeat
, . ., , . , . . , , , . , . ng-repeat
. .
DOM ng-include
innerHTML
, . . .
, - , , . API , .
Source: https://habr.com/ru/post/181882/
All Articles