AngularJs can’t access form object in controller ($scope)

Just for those who are not using $scope, but rather this, in their controller, you’ll have to add the controller alias preceding the name of the form. For example:

<div ng-controller="ClientsController as clients">
  <form name="clients.something">
  </form>
</div>

and then on the controller:

app.controller('ClientsController', function() {
  // setting $setPristine()
  this.something.$setPristine();
};

Hope it also contributes to the overall set of answers.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)