You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add config and custom template support
Allow to:
- Configure plugin in Angular config phase, instead of in the HTML
- Use a custom flash message template, given in config or transcluded
Other changes:
- Add default configuration
- Write HTML on several lines
* Fix transclude scope
* Add documentation for config and custom template
* Version 2.3.0
class="octicon octicon-link"></span></a>Use a custom template</h4>
151
+
<p>By default, angular-flash use the Bootstrap flash standard template, but you can set your own template.</p>
152
+
153
+
<p><strong>By giving it in the Js</strong>: use <i>.setTemplate(...)</i> with the template in parameter.</p>
154
+
<preclass="prettyprint linenums">
155
+
app.config((FlashProvider) => {
156
+
FlashProvider.setTemplate(`
157
+
<divclass="my-flash">{{ flash.text }}</div>
158
+
`);
159
+
});</pre>
160
+
161
+
<p><strong>By giving it in the HTML</strong>: use <i>.setTemplatePreset('transclude')</i> with the template transcluded in the <i><flash-message></i> directive.</p>
0 commit comments