DefinitelyTyped/types/angular-notify/angular-notify-tests.ts
2017-03-24 14:27:52 -07:00

31 lines
907 B
TypeScript

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();
}
]);