I want to create a my directive for read the input type="file" but I fail in this problem. I write the my code in page html in this way:
<body ng-controller="insertController">
<div>
<input type="file" file-model="myFile"/>
</div>
<div>
{{message}}
</div>
</body>
So I want read the file and show the result in {{message}}. So I created a directive in this way:
modulo.directive('fileModel', function() {
return {
restrict: 'AEC',
templateUrl: 'insert.html',
link: function(scope, element, attrs) {
scope.message = attrs.fileModel;
}
};
});
Moreover I read my controller but it's empty...
modulo.controller('insertController', function($scope, $http) {
});
How can I fix the problem?Thanks!