I've been attempting to clear ng-model inputs, but haven't had any success and I can't seem to figure out why.
Here is what I have:
<button ng-click="$ctrl.clear()"></button>
And in the clear action, I have:
$scope.$event = null;
It should work, right?
If I do this directly in the HTML:
<button ng-click="$event = null"></button>
It will work, but I want to avoid doing this in the HTML if possible.
I've already tried using angular.copy and:
$scope.$event = {};
$scope.$event = '';
But it doesn't seem to work and isn't providing me with any error messages.
Thank you.
UPDATE:
<input type="text" ng-model="$event.title"/>
<input type="text" ng-model="$event.name"/>
<input type="number" ng-model="$event.age"/>
<input type="date" ng-model="$event.date"/>