3
我試圖建立在angularJS一個簡單通知服務:
angular.module("my.services", [])
.service("NotificationsService", function() {
this.show = function(message, options) {
// display a notification
};
this.error = function(message) {
this.show({...});
}
...
});
當服務器返回嵌入API一個「通知」陣列將被解僱:
{
notifications: [{type: "error", message: "Error message"}, ...],
data: [item1, item2, ...]
}
現在我想插入我的服務,以$ HTTP,但我不能找到一種方法,這樣做的!...
任何想法?
太好了!謝謝你的幫助 ! :) – TiuSh
太酷了!要命 – iamwhitebox