Using ng-change in AngularJS with “Controller As” syntax
问题 I am trying to avoid using $scope in my controller function, instead opting to use var viewModel = this; with "controller as" viewModel syntax. My problem is that I need to use ng-change to call a function in my controller but while I am able to access data from a service, I am unable to call functions. //Controller (function () { 'use strict'; angular .module('app') .controller('GeneralSettingsController', GeneralSettingsController); GeneralSettingsController.$inject = ['SimulationService'];