Angular Problem.js with input when using ng-model & ng-change in the same input

1

I have a problem when I try to use an ng-model together with an ng-change in an input it gives me the following

error => Error: [$compile:ctreq] Controller 'ngModel', required by directive 'ngChange', can't be found!

Code

<div class="wn_row wn_row-collapse">
  <div class="wn_name">Sub-máscara de Rede</div>
  <div class="wn_value"> 
    <input type="text" class="wn_text" ng-model="lanConfPage.lanconn.dhcp_server.subnet" ng-change="lanConfPage.subnetChanged()">
   </div>

In the controller I have the following code. lanConfPage is the name of the controller

constructor(netmapManager: NosNetmapManager, public chfBlockUI) {
    this.lanconn = <any>netmapManager.netmap.lanconns[0];
    this.bridgeMode = <any>netmapManager.netmap.bridge_mode;
    this.leaseTime = this.getLeaseTimeInMin();
  }

subnetChanged() : void {
    let message : string = "wwwww";
    document.getElementById("messageInfo").innerHTML = message;
  }

export var _chfMetadata: chf.core.PageComponentMeta = {
  name: 'chfLanConfPage',
  path: "/settings/lan_conf",
  menuTitleKey: 'menu.LAN',
  position: 2,
  parentId: 'settings',
  component: () => {
    return {
      controller: LanConfPage,
      controllerAs: 'lanConfPage',
      template: require('./chf-lan-conf-page.tpl.html'),
      bindToController: true
    }
  }
};

I do not understand what the problem is. Thank you very much

    
asked by Reynier Téllez 24.08.2016 в 14:57
source

0 answers