CKEDITOR.replaceAll自定义断言函数的语法是什么?

时间:2016-04-06 20:55:16

标签: javascript ckeditor assert assertions assertion

我想有选择地避免用CKEDITOR.replaceAll替换textareas。我不能简单地使用替换。我必须使用文档中提到的自定义断言函数。

http://docs.ckeditor.com/#!/api/CKEDITOR-method-replaceAll

Config your routes
app.config(['$routeProvider',
    function($routeProvider) {
        $routeProvider.
            when('/page1', {
                templateUrl: 'views/page1.html'
            }).
            when('/page2', {
                templateUrl: 'views/page2.html'
            }).
            otherwise({
                redirectTo: '/'
            });
    }])

但是javascript中没有$scope.pagename = function() { return $location.path(); }; $scope.goTo = function(page){ $location.path(page); } 。断言的语法是什么?

1 个答案:

答案 0 :(得分:6)

CKEDITOR documentation中使用“断言功能”具有误导性。 javascript中没有// Selectively replace <textarea> elements, based on custom assertions. CKEDITOR.replaceAll( function( textarea, config ) { // An assertion function that needs to be evaluated for the <textarea> // to be replaced. It must explicitely return "false" to ignore a // specific <textarea>. // You can also customize the editor instance by having the function // modify the "config" parameter. } ); 。只需使用条件语assert即可忽略特定的assert

示例:

return false