Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

component controller not binding to ng-transclude template scope  #15998

@omkadiri

Description

@omkadiri

Am trying to transclude a template into component for customization purpose but the binding to the template is not working

simple
component controller and transclude template

let simpleComponent = {
    template: './simple.html',
    bindings: {
        title: '<'
    },
    transclude: true,
    controller: simpleController
};

class simpleController {
   constructor()

   getNext(){
     return true;
   }
}

angular.module('commonModule.pdfViewer', [])
    .controller('simpleController', simpleController)
    .component('simpleComponent', simpleComponent);

   <simple-component>
        <div ng-click="$ctrl.getNext()">{{$ctrl.title}}</div>
   </simple-component>

Am i missing something here? the above will work for a directive if the function is $scope.getNext()

simple.html


<div>
   <div ng-transclude></div>
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions