Angularjs 排除不在工作状态下工作
我创建了一个名为first的指令。如下Angularjs 排除不在工作状态下工作,angularjs,Angularjs,我创建了一个名为first的指令。如下 <div first> <p>aaaaaa11111</p> </div> AAAAA11111 棱角状 var testdirective = angular.module("testdirective",[]); testdirective.directive('first', function() { return { transclude: t
<div first>
<p>aaaaaa11111</p>
</div>
AAAAA11111
棱角状
var testdirective = angular.module("testdirective",[]);
testdirective.directive('first', function()
{
return
{
transclude: true,
template: '<div> This is my directive content</div>'
}
});
var testdirective=angular.module(“testdirective”,[]);
指令('first',function()
{
返回
{
是的,
模板:“这是我的指令内容”
}
});
运行文件“aaaaaa 11111”时,内容未显示y….您使用了错误的模板()
模板:“这是我的指令内容”
您使用了错误的模板()
模板:“这是我的指令内容”
您使用了错误的模板()
模板:“这是我的指令内容”
您使用了错误的模板()
模板:“这是我的指令内容”
您没有在模板中使用ng trasclude指令。
以下是更新代码:
HTML:
<div ng-app="testdirective">
<div first>
<p>aaaaaa11111</p>
</div>
</div>
AAAAA11111
JavaScript
var testdirective = angular.module("testdirective",[]);
testdirective.directive('first', function() {
return {
transclude: true,
template: '<div> This is my directive content<span ng-transclude></span></div>'
}
});
var testdirective=angular.module(“testdirective”,[]);
指令('first',function(){
返回{
是的,
模板:“这是我的指令内容”
}
});
你可以结账。它有运行演示
有关更多详细信息,请查看博客。您没有在模板中使用ng trasclude指令。 以下是更新代码: HTML:
<div ng-app="testdirective">
<div first>
<p>aaaaaa11111</p>
</div>
</div>
AAAAA11111
JavaScript
var testdirective = angular.module("testdirective",[]);
testdirective.directive('first', function() {
return {
transclude: true,
template: '<div> This is my directive content<span ng-transclude></span></div>'
}
});
var testdirective=angular.module(“testdirective”,[]);
指令('first',function(){
返回{
是的,
模板:“这是我的指令内容”
}
});
你可以结账。它有运行演示
有关更多详细信息,请查看博客。您没有在模板中使用ng trasclude指令。 以下是更新代码: HTML:
<div ng-app="testdirective">
<div first>
<p>aaaaaa11111</p>
</div>
</div>
AAAAA11111
JavaScript
var testdirective = angular.module("testdirective",[]);
testdirective.directive('first', function() {
return {
transclude: true,
template: '<div> This is my directive content<span ng-transclude></span></div>'
}
});
var testdirective=angular.module(“testdirective”,[]);
指令('first',function(){
返回{
是的,
模板:“这是我的指令内容”
}
});
你可以结账。它有运行演示
有关更多详细信息,请查看博客。您没有在模板中使用ng trasclude指令。 以下是更新代码: HTML:
<div ng-app="testdirective">
<div first>
<p>aaaaaa11111</p>
</div>
</div>
AAAAA11111
JavaScript
var testdirective = angular.module("testdirective",[]);
testdirective.directive('first', function() {
return {
transclude: true,
template: '<div> This is my directive content<span ng-transclude></span></div>'
}
});
var testdirective=angular.module(“testdirective”,[]);
指令('first',function(){
返回{
是的,
模板:“这是我的指令内容”
}
});
你可以结账。它有运行演示
有关更多详细信息,请查看博客