【发布时间】:2016-03-18 06:25:24
【问题描述】:
我正在使用此代码 - https://github.com/rahil471/scalable-angularjs-project-setup-gulp-browserify
它工作正常。但我面临的唯一问题是
该指令不起作用。
我做了什么 - 我在 'src' 的 'componenets' 中添加了 'directive' 文件夹,它完美地在 'public' 的组件中创建了 'directive' 的副本,但它正在显示应用程序未定义。 我在“directive”文件夹中创建了 custom.js 文件并将其包含在 index.html(最外层)中。
custom.js
app.directive('mydir', function() {
return {
restrict: 'E',
template: '<h1>ANIL</h1>'
};
});
在'src'的'component'中的about.html中添加
代码完美复制到'public'中'component'中的about.html。
【问题讨论】:
标签: angularjs angularjs-directive gulp browserify