Commit 85b9097ce4eada5e50b60d5b433893fafbc08468
Exists in
master
Merge branch 'master' of git.viithiisys.com:viithiisys/acufuel
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
Showing
1 changed file
Show diff stats
app/js/app.js
... | ... | @@ -26,6 +26,22 @@ |
26 | 26 | } |
27 | 27 | } |
28 | 28 | }]) |
29 | + | |
30 | + .directive('fileModel', ['$parse', function ($parse) { | |
31 | + return { | |
32 | + restrict: 'A', | |
33 | + link: function(scope, element, attrs) { | |
34 | + var model = $parse(attrs.fileModel); | |
35 | + var modelSetter = model.assign; | |
36 | + | |
37 | + element.bind('change', function(){ | |
38 | + scope.$apply(function(){ | |
39 | + modelSetter(scope, element[0].files[0]); | |
40 | + }); | |
41 | + }); | |
42 | + } | |
43 | + }; | |
44 | + }]) | |
29 | 45 | |
30 | 46 | .provider('myCSRF',[function(){ |
31 | 47 | var headerName = 'X-CSRFToken'; | ... | ... |