-
Notifications
You must be signed in to change notification settings - Fork 879
docs(cookbook - item template) Cookbook for a component item template. #1862
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,12 @@ | |||
/* tslint:disable */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't actually know what that line does. I saw that you added it to one of my other cookbooks:
... so I just copied it over here as well. Should I remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember why I did it. I will come back to this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Foxandxss it looks like if I remove it I get:
[08:46:47] [gulp-tslint] error cb-item-template/ts/app/main.ts[6, 9]: function invocation disallowed: console.info
[08:46:57] 'lint' errored after 18 s
[08:46:57] Error in plugin 'gulp-tslint'
In a general note. We are using double quotes Is better to maintain consistency. |
|
||
it('should toggle the menu', function () { | ||
|
||
expect( element( by.className( 'select-items' ) ).isPresent() ).toBe( false ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the spaces between parens parameters are nice, but that is not the convention we use in this project so I would ask you for remove them in all the files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, I can do that. I didn't realize that was part of the style.
@Foxandxss when you say "double quotes in the HTML", what file are you referring to? I'm trying to use single-quotes all over the place, as that's what Ward asked me to do. If there are double-quotes somewhere, it's just an oversight on my part. But, I don't see what you are referring to. |
On the templates.
vs
|
63dc3d7
to
0579d6d
Compare
@Foxandxss ok, I think I addressed all of your concerns. |
<simple-select | ||
[items]="colors" | ||
[(value)]="selectedColor" | ||
[template]="externalTemplate"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would make sense to name it templateRef
or itemTemplateRef
?
I had a look at this PR since was curious how the template outlet thingy is going to be described. I like the example a lot! Good stuff! |
This cookbook demonstrates how to provide a component with an external `TempalteRef` that the component can then use to render aspects of its own internal template. An example of this, as explored in the cookbook, is providing a select-menu component with an item template that the component can use to render the options in its dropdown.
7d19a90
to
afbe26f
Compare
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
1 similar comment
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
This cookbook demonstrates how to provide a component with an external
TemplateRef
that the component can then use to render aspects of its owninternal template. An example of this, as explored in the cookbook, is
providing a select-menu component with an item template that the component
can use to render the options in its dropdown.