第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

關(guān)于angularjs $provide的decorator函數(shù)使用報錯。

關(guān)于angularjs $provide的decorator函數(shù)使用報錯。

繁星coding 2018-09-07 09:09:37
話不多說,在我的controller中我打印一下我的service foo,當(dāng)我沒有在 config中使用 如下代碼時    $provide.decorator('foo',function($delegate){         $delegate.greet = function(){            return "Hello, I am a new function of 'foo'";         }     });這個foo服務(wù)代碼是;appService.provider('foo', [function () {    var thisIsPrivate = "Private";    return {         setPrivate: function(newVal) {             thisIsPrivate = newVal;         },         $get: function() {            function getPrivate() {                return thisIsPrivate;             }            return {                 variable: "This is public",                 getPrivate: getPrivate             };         }     }; }])當(dāng)我不適用修飾器時,在controller中注入foo,是可以打印并且正常使用的,但是當(dāng)我在 app.config中使用修飾器時,打印foo顯示undefined,介是為嘛呢?這個例子來自http://www.html-js.com/articl...
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 717 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號