Skip to content

Commit

Permalink
added param "name of the block" for the API document of has-block and…
Browse files Browse the repository at this point in the history
… has-block-params

(cherry picked from commit c39b050)
  • Loading branch information
habdelra authored and kategengler committed Mar 25, 2019
1 parent 84767f9 commit b179dfd
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/@ember/-internals/glimmer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
This component is invoked with a block:
```handlebars
{{#my-component}}
Hi Jenn!
Hi Jen!
{{/my-component}}
```
Expand All @@ -194,6 +194,15 @@
{{my-component}}
```
Using angle bracket invocation, this looks like:
```html
<MyComponent>Hi Jen!</MyComponent> {{! with a block}}
```
```html
<MyComponent/> {{! without a block}}
```
This is useful when you want to create a component that can optionally take a block
and then render a default template when it is not invoked with a block.
Expand All @@ -207,6 +216,7 @@
@method hasBlock
@for Ember.Templates.helpers
@param {String} the name of the block. The name (at the moment) is either "main" or "inverse" (though only curly components support inverse)
@return {Boolean} `true` if the component was invoked with a block
@public
*/
Expand All @@ -217,7 +227,7 @@
This component is invoked with block params:
```handlebars
{{#my-component as |favoriteFlavor|}}
Hi Jenn!
Hi Jen!
{{/my-component}}
```
Expand All @@ -243,6 +253,7 @@
@method hasBlockParams
@for Ember.Templates.helpers
@param {String} the name of the block. The name (at the moment) is either "main" or "inverse" (though only curly components support inverse)
@return {Boolean} `true` if the component was invoked with block params
@public
*/
Expand Down

0 comments on commit b179dfd

Please sign in to comment.