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.

ng-model-options in a template of component makes error in angular 1.6.0 #15492

Closed
@darius-khll

Description

@darius-khll

I have this following code written in typescript


let app = angular.module('app', []);

app.component('testComponent', {
    controllerAs: 'ctrl',
    controller: class SampleComponent {
        public id: number = 10;
    },
    template: '<div><test-directive ng-model="ctrl.id"></test-directive> {{ctrl.id}} </div>'
});

class TestDirective implements ng.IDirective {

    public terminal = true;
    public scope = false;
    public replace = true;
    public required = 'ngModel';
    public template = `<input type="text" ng-model-options="{ updateOn : 'change' , allowInvalid : true }" />`;

    public constructor() { }
}

app.directive('testDirective', () => new TestDirective());

I'm using this component as well in angular 1.5.9 and doesn't have any problem an issue, but when I updated to angular 1.6.0 it makes error, consider this error

TypeError: Cannot read property 'getOption' of undefined

what's wrong ?

sample link

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions