【发布时间】:2017-05-26 04:57:45
【问题描述】:
我添加了.run函数如下:
coursesApp.run(['$rootScope'], function ($rootScope) {
$rootScope.slugLinkCompany = function(item, link) {
if (item) {
var makeSlug = item.name.toLowerCase().replace(/[^\w ]+/g,'').replace(/ +/g,'-');
return item.name ? [link, makeSlug, item.id].join('/') : null;
}
};
$rootScope.slugLinkCourse = function(item, link) {
if (item) {
var makeSlug = item.title.toLowerCase().replace(/[^\w ]+/g,'').replace(/ +/g,'-');
return item.title ? [link, makeSlug, item.id].join('/') : null;
}
};
$rootScope.slugLinkCategory = function(item, link) {
if (item) {
var makeSlug = item.name.toLowerCase().replace(/[^\w ]+/g,'').replace(/ +/g,'-');
return item.name ? [link, makeSlug, item.id].join('/') : null;
}
};
});
不幸的是,当我丑化它时,我遇到了以下错误。
Error: $injector:unpr
Unknown Provider
请让我知道我错过了什么。谢谢。
【问题讨论】:
标签: javascript angularjs gulp-uglify