mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-11 08:13:10 +00:00
parent
51d501aab2
commit
98489a1d0c
1 changed files with 9 additions and 6 deletions
|
|
@ -528,6 +528,7 @@ dialog component may work.
|
||||||
on-ok="show = false; doSomething()">
|
on-ok="show = false; doSomething()">
|
||||||
Body goes here: {{username}} is {{title}}.
|
Body goes here: {{username}} is {{title}}.
|
||||||
</dialog>
|
</dialog>
|
||||||
|
</div>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
Clicking on the "show" button will open the dialog. The dialog will have a title, which is
|
Clicking on the "show" button will open the dialog. The dialog will have a title, which is
|
||||||
|
|
@ -537,7 +538,7 @@ into the dialog.
|
||||||
Here is an example of what the template definition for the `dialog` widget may look like.
|
Here is an example of what the template definition for the `dialog` widget may look like.
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<div ng-show="show">
|
<div ng-show="visible">
|
||||||
<h3>{{title}}</h3>
|
<h3>{{title}}</h3>
|
||||||
<div class="body" ng-transclude></div>
|
<div class="body" ng-transclude></div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
|
@ -557,10 +558,10 @@ expects as follows:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
scope: {
|
scope: {
|
||||||
title: '=', // set up title to accept data-binding
|
title: '@', // the title uses the data-binding from the parent scope
|
||||||
onOk: '&', // create a delegate onOk function
|
onOk: '&', // create a delegate onOk function
|
||||||
onCancel: '&', // create a delegate onCancel function
|
onCancel: '&', // create a delegate onCancel function
|
||||||
show: '='
|
visible: '=' // set up visible to accept data-binding
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
@ -591,11 +592,13 @@ Therefore the final directive definition looks something like this:
|
||||||
<pre>
|
<pre>
|
||||||
transclude: true,
|
transclude: true,
|
||||||
scope: {
|
scope: {
|
||||||
title: '=', // set up title to accept data-binding
|
title: '@', // the title uses the data-binding from the parent scope
|
||||||
onOk: '&', // create a delegate onOk function
|
onOk: '&', // create a delegate onOk function
|
||||||
onCancel: '&', // create a delegate onCancel function
|
onCancel: '&', // create a delegate onCancel function
|
||||||
show: '='
|
visible: '=' // set up visible to accept data-binding
|
||||||
}
|
},
|
||||||
|
restrict: 'E',
|
||||||
|
replace: true
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
# Creating Components
|
# Creating Components
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue