我不确定我完全理解AngularJS中的装饰器--我正在尝试修改TextAngular,如下面的示例:https://github.com/fraywing/textAngular/wiki/Setting-Defaults
我的代码:
angular.module('MyAngularApp', ['cfp.hotkeys', 'omr.angularFileDnD', 'textAngular']);
angular.module('MyAngularApp', ['textAngular']).config(['$provide', function ($provide) {
// changing the classes of the icons
$provide.decorator('taTools', ['$delegate', function (taTools) {
taTools.bold.iconclass = 'icon icon-button';
return taTools;
}]);
}]);使用这个装饰器活动,我只是得到一个空白的网页,没有错误信息。
有什么想法吗?
发布于 2014-12-16 13:55:46
@JoelJeske的评论是正确的-只要得到你的模块,不要重新声明它。
angular.module('MyAngularApp', ['cfp.hotkeys', 'omr.angularFileDnD', 'textAngular']);
angular.module('MyAngularApp').config(['$provide', function ($provide) {
// changing the classes of the icons
$provide.decorator('taTools', ['$delegate', function (taTools) {
taTools.bold.iconclass = 'icon icon-button';
return taTools;
}]);
}]);https://stackoverflow.com/questions/27505328
复制相似问题