- jQuery 1.10 or Higher
Modulo ngNotify
Servicio $notify
<button type="button" ng-click="click()">Notify</button>angular.module('myapp',['ngNotify']).
controller('ctrlmain', function($scope, $notify){
$scope.click = function(){
$notify.success('title','message');
}
$notify.info('title','message');
$notify.warning('title','message');
$notify.error('title','message');
});- setPosition
angular.module('myapp',['ngNotify']).
controller('ctrlmain', function($scope, $notify){
$scope.click = function(){
// bottom-left, bottom-center, bottom-right
// top-left, top-center, bottom-right
// bottom-full-width, top-full-width
$notify.setPosition('bottom-left');
$notify.success('title','message');
}
});- setTime
angular.module('myapp',['ngNotify']).
controller('ctrlmain', function($scope, $notify){
$scope.click = function(){
$notify.setTime(5); // set time in seg
$notify.success('title','message');
}
});- setTimeExtend
angular.module('myapp',['ngNotify']).
controller('ctrlmain', function($scope, $notify){
$scope.click = function(){
$notify.setTimeExtend(5); // set time in seg
$notify.success('title','message');
}
});- showCloseButton
angular.module('myapp',['ngNotify']).
controller('ctrlmain', function($scope, $notify){
$scope.click = function(){
$notify.showCloseButton(true); // set boolean
$notify.success('title','message');
}
});- showProgressBar
angular.module('myapp',['ngNotify']).
controller('ctrlmain', function($scope, $notify){
$scope.click = function(){
$notify.showProgressBar(true); // set boolean
$notify.success('title','message');
}
});- onclick
angular.module('myapp',['ngNotify']).
controller('ctrlmain', function($scope, $notify){
$scope.click = function(){
$notify.onclick(function(){
document.location.href = "https://google.com.ni";
}); // set a function
$notify.success('title','message');
}
});$notify.setTime(10).setPosition('bottom-right').showCloseButton(true).showProgressBar(true);