0

我有一个要包含在页面中的角度组件。如果我在此组件中注释/删除绑定参数,一切正常...为什么?

(function () {

    angular.module('app').component('detailsComponent1', {
        templateUrl: '/RealSuiteApps/RealForm/-1/Details/Component1',
        restrict: 'E',
        bindings: {
            value: "Component1"
        },
        controllerAs: 'cm',
        controller: function () {
            this.message = 'Hello from component1';
        }
    });

})();

如果我想使用绑定参数,我会得到一个错误:

在此处输入图像描述

链接到:https://docs.angularjs.org/error/ $compile/iscp?p0=detailsComponent1&p1=value&p2=Component1&p3=controller%20bindings%20definition

这是什么意思 ??

谢谢。

4

1 回答 1

2

好吧,错误是因为Invalid Isolate scope

声明隔离范围时,范围定义对象必须采用特定格式,以模式字符(@&=<)开头,之后是可选的 ?,并以可选的本地名称结尾。

请在此处找到参考链接:https : //docs.angularjs.org/error/$compile/iscp

另外,您在组件中有一些废弃的指令属性。

限制(仅限于组件的元素)

请在此处找到组件的文档:https ://docs.angularjs.org/guide/component

希望对你有帮助!

干杯

于 2016-07-29T18:31:42.707 回答