require(['jquery', 'px/extensions/growl'], function($) {
...
});
To use growl plugin, you need to include the next scripts:
<script src="path/to/js/libs/jquery.growl.js"></script>
<script src="path/to/js/pixeladmin/extensions/growl.js"></script>
<script src="path/to/js/pixeladmin/directives/angular-growl.js"></script>
Then inject the plugin into your angular application:
angular.module('yourApp', ['growl']);
Alternatively, you can include growl plugin using ocLazyLoad plugin:
$ocLazyLoad.load([
{
serie: true,
name: 'growl',
files: [
'path/to/js/libs/jquery.growl.js',
'path/to/js/pixeladmin/extensions/growl.js',
'path/to/js/pixeladmin/directives/angular-growl.js',
],
},
]);
$growl
service
Inject $growl
service into a controller to create notifications.
By default it comes with five types of notification messages:
default
success
error
notice
warning
See available options at the plugin's documentation.
function SomeController($growl) {
$growl.default(options);
$growl.success(options);
$growl.error(options);
$growl.notice(options);
$growl.warning(options);
});