DefinitelyTyped/types/angular-notify/angular-notify-tests.ts

32 lines
908 B
TypeScript
Raw Permalink Normal View History

2016-05-10 19:22:25 +00:00
2014-10-27 01:30:28 +00:00
var myapp = angular.module("myapp", ["cgNotify"]);
myapp.controller("MyController", ["$scope", "cgNotify",
function ($scope:ng.IScope, notify:ng.cgNotify.INotifyService) { // <-- Inject notify
var notifyObj = notify("Your notification message"); // <-- Call notify with your message
notifyObj.close();
notify.config({
startTop: 10,
verticalSpacing: 15,
duration: 10000,
templateUrl: "angular-notify.html",
position: "center",
container: document.body
});
notify( {
message: "My message",
templateUrl: "my_template.html",
position: "center",
container: document.body,
classes: "", // <-- CSS class names
$scope: $scope
}); // <-- Call notify with your message + option
notify.closeAll();
}
2020-05-15 02:20:31 +00:00
]);