Skip to content

Commit

Permalink
Merge pull request #128 from maxwondercorn/angle-brackets
Browse files Browse the repository at this point in the history
Angle brackets
  • Loading branch information
btecu authored May 29, 2019
2 parents f6c00a9 + 0a81970 commit de6f314
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ By default the notifications close after 2.5 seconds, although you can control t
{{ember-notify closeAfter=4000}}
```

Using angle bracket invocation, available in Ember 3.4+

```handlebars
<EmberNotify @closeAfter={{4000}} />
```

Or you can control when each message is closed:

```js
Expand Down Expand Up @@ -97,6 +103,12 @@ The others you will need to provide a `source` property, so secondary containers
{{ember-notify source=someProperty}}
```

Using angle bracket invocation

```hbs
<EmberNotify @source={{someProperty}} />
```

```js
import Component from '@ember/component';
import Notify from 'ember-notify';
Expand Down Expand Up @@ -125,6 +137,19 @@ You can pass a block with template you want to use for each message (instead of
{{/ember-notify}}
```

Using angle bracket invocation

```hbs
<EmberNotify as |message close|>
<a {{action close}} class='close'>
close from block
</a>
<span class='message-from-block'>
{{message.text}}
</span>
</EmberNotify>
```

Two arguments are passed to the block: `message` object, and `close` action. Make sure
you are using *Closure Actions* syntax passing the action (e. g. `<a {{action close}}` or
`{{your-component close=(action close)}}`.
Expand All @@ -139,6 +164,14 @@ By default, the `ember-notify` message will appear in the bottom right corner of
```

Using angle bracket invocation

```hbs
<!-- gives class="ember-view ember-notify-cn custom-notify"> to top level element-->
<EmberNotify @classPrefix={{"custom-notify"}} />
```

Then you need to add custom styling for each of the elements within the `ember-notify` structure.
The following snippet summarizes rules needed for a custom look. For a complete example that you can drop into your project, see [examples/custom-position-animations.css](examples/custom-position-animations.css)

Expand Down

0 comments on commit de6f314

Please sign in to comment.