Eric- thank you VERY much - worked - that's a __huge__ help

On Tue, Sep 1, 2015 at 4:43 AM, Eric Martinez <[email protected]>
wrote:

> Hey Lior,
>
> first of all, I'm going to solve this using alpha36 which was released
> today
>
> Your first issue is that you are using "content" which was replaced with
> "ng-content" a few alphas ago (don't remember how many).
> Second, I'm assuming that you are injecting "C2Dropdown" into another
> Component (I'll call it MainCmp), so your code would look like this
>
> @Component({
>   selector: 'c2-dropdown',
>   properties:['items']
> })
> @View({
>   template: `
>   <div>
>        <ng-content></ng-content>
>   </div>`
> })
> export class C2Dropdown {
>   constructor() {
>   }
>
> }
>
>
> @Component({
>  selector : 'app'
> })
> @View({
>  template: `
>  <c2-dropdown items="['11','12']">
>     ++{{items}}++
>   </c2-dropdown>`,
>   directives : [C2Dropdown]
> })
> class MainCmp {
>  constructor() {
>  }
>
>
>  onInit() {
>  }
> }
> bootstrap(MainCmp);
>
> If you want to set a attach a property to a component, you must enclose it
> within "[]". Another issue, since you are calling "{{items}}" from a
> MainCmp, the compiler is looking for "items" in MainCmp.
>
> The easiest way to do what you want is like this
>
> @View({
>  template: `
>  <c2-dropdown #dropdown items="['11','12']">
>     ++{{dropdown.items}}++
>   </c2-dropdown>`,
>
> Like this you are binding the component to "#dropdown" and then you are
> printing "dropdown"'s items.
>
> For you can look it better I've set up this plnkr:
> http://plnkr.co/edit/87uJVSfojFgcCVNfC3XP?p=preview
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/8yoAgJOdwNU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Lior Messinger
+1-646-3730044
+972-546-888401

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to