So I have a clearNotification function I want to trigger when I click the '#upload' button. I set an ng-click on that button to trigger notify().
What I'm wondering is if it's a violation of separation of concerns to put that clearNotification function within notify(). Is it better to add that as another ng-click on '#upload'? Or is this where directives come in?
Would love any input on this.
So far, this is what my code looks like:
HTML:
<button id="upload" ng-click="notify()">Upload</button>
Controller:
$scope.clearNotification = function() {
$scope.notification = '';
};
$scope.notify = function() {
$scope.clearNotification();
...
};
clearNotificationin the scope? Do you use it somewhere like inngClick? You maybe only need normal function definitionfunction clearNotification() {...}.