0
我需要幫助來創建自定義過濾器或指令,而不是替換模板的單詞。例如,在文本「我的產品NEW」中,我想用'NEW'替換模板'isnew.html' 任何可以幫助我嗎?AngularJS:替換模板文本的過濾器或指令
我需要幫助來創建自定義過濾器或指令,而不是替換模板的單詞。例如,在文本「我的產品NEW」中,我想用'NEW'替換模板'isnew.html' 任何可以幫助我嗎?AngularJS:替換模板文本的過濾器或指令
HTML:
<div ng-bind-html="getText()"></div>
控制器:
$scope.getText = function(){
var new = $templateCache.get('isnew.html');
return 'My product ' + new;
}
你能解釋一下你的答案位? – Sampath
我不能上班 –
最近我會提供一個蹦牀 – MarkoCen