Can you assist in resolving this issue by utilizing a form on JSFiddle?
If a user fills out the following fields:
name, email, phone, message
The data should be output to the console.
However, if a user adds a file to the field
attachment
No output should appear in the console (console should display "55555").
JavaScript code:
briefApp.directive('attachmentValidate', function() {
return {
link: function($scope, element, attrs, ctrl) {
$scope.$watch('attachment', function(value){
console.log(55555);
});
}
};
});
I am looking for guidance on how to ensure that adding or removing a file triggers the 'attachmentValidate' controller and logs "55555" in the console.