0

I have an angular component that I want to include in my page. everything works if I comment/remove bindings parameter in this component... Why?

(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';
        }
    });

})();

If I want to use binding parameter, I get an error:

enter image description here

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

What does it mean ??

Thanks.

2
  • So? The template comes from MVC call, it has nothing to do with the question. I said, everything works if I remove bindings... Commented Jul 29, 2016 at 18:26
  • remove restrict: 'E', as well. Error is because of value: "Component1" make it like value: @Component1 or value: =Component1 Commented Jul 29, 2016 at 18:27

1 Answer 1

2

Well, The error is coming because of Invalid Isolate scope

When declaring isolate scope the scope definition object must be in specific format which starts with mode character (@&=<), after which comes an optional ?, and it ends with an optional local name.

Please find the reference link here: https://docs.angularjs.org/error/$compile/iscp

Plus, you have some discarded directive property inside component.

restrict (restricted to elements for component)

Please find documentation for component here: https://docs.angularjs.org/guide/component

Hope it helps you!

Cheers

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.