Last active
December 16, 2015 10:54
-
-
Save lega911/09a75ea343523013b525 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// current | |
alight.filters.toString = function(exp, scope) { | |
return function(val) { | |
return val.toString() | |
} | |
} | |
// new style | |
alight.filters.toString = function(val, exp, scope) { | |
return val.toString() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// current | |
alight.filters.format = function(exp, scope, env) { | |
var fn = scope.$compile(exp); | |
return { | |
watchMode: 'deep', | |
onChange: function(value) { | |
env.setValue(fn(value)) | |
}, | |
onStop: function(value) {} | |
} | |
} | |
// new style | |
alight.filters.format = { | |
watchMode: 'deep', | |
init: function(exp, scope) { | |
this.fn = scope.$compile(exp) | |
}, | |
onChange: function(value) { | |
this.setValue(this.fn(value)) | |
}, | |
onStop: function() {} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment