Closed ghost closed 9 years ago
1) Attributes:
@Component({ ..., bind: { myAttr: '=' } })
2) Search the README for ngmodel. There it shows you how to refer to component's controllers, including your own ngModel.
Also, bind takes the same syntax as scope with regular Angular 1 attributes.
I mean directives that are restrict A.
On Mon, Jul 27, 2015, 12:38 AM pbastowski notifications@github.com wrote:
Also, bind takes the same syntax as scope with regular Angular 1 attributes.
— Reply to this email directly or view it on GitHub https://github.com/pbastowski/angular2-now/issues/17#issuecomment-125111441 .
@robertbaker Sorry for the late reply, I was on vacation until yesterday, without my laptop or reasonable internet.
Both "E" and "A" type directives support transclusion. Just add a <content></content>
block in your template
's HTML where you want the transcluded content to appear and transclude will be set to true automatically for you. If using templateUrl
you'll have to add the <div ng-transclude></div>
yourself and pass transclude:true
into the options of @View
See this https://github.com/pbastowski/angular2-now#transclude-and-contentcontent section of the README for an example.
I hope the question was answered adequately. I'm closing this issue.
How can I declare Attributes?
Does it assume a @Component is an attribute is no @View is used?
Also for directives how can I set transclude: true or require: ngModel