Activity Forums Salesforce® Discussions How to build example of raising an event from a nested Salesforce component in Angular2?

  • Archit

    Member
    March 29, 2018 at 12:32 pm

    To use the Component we declare it inside a template and use a custom attribute on the element itself.

    const app = {
    template: `
    <div>
    My Counter:
    <counter
    count="$ctrl.count"
    on-update="$ctrl.countUpdated($event);"></counter>
    </div>
    `,
    controller() {
    this.count = 2;
    this.countUpdated = (event) => {
    this.count = event.count;
    };
    }
    };

    angular
    .module('app')
    .component('app', app);

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos