に渡されたものに基づいて異なるHTMLでディレクティブは、私はその後、私のディレクティブはサービスを呼び出し、それがcontent
角度リターン
<lcd-code lcdcode="{{data.code}}"></lcd-code>
のように見えますhtmlコード内のディレクティブを持っています
// the top part of the directive
template: '<div ng-bind-html-unsafe="content"></div>', //'<div>blah</div>',
link: function (scope, element, attrs) {
var res = "";
var promise = customerService.getKey(attrs.lcdcode)
.then(function (result) {
res = result;
scope.content = result;
console.log('scope.content', scope.content);
})
.catch(function() {
console.log('problem');
});
}
//bottom part of directive ...
何data.codeがあると私は渡しています0または1など。
だから私は本当にカスタム送り返されるHTMLを構築されて何をしたいのか...
は、それがその後、私はそれが1
が、私はどのようにすることができます
<div>
<div> this is not ok</div>
</div>
を送信したい場合はアウトバック
<div>ok now</div>
を送りたい
に渡さ0
あると言います私はこれを達成する?
を注入... –