Implemented controller as a mixin

This commit is contained in:
Borys Levytskyi
2015-04-03 11:50:38 +03:00
parent 47015a951c
commit ce2db72582
2 changed files with 29 additions and 11 deletions

View File

@@ -2,9 +2,9 @@
app.controller('expressionInputCtrl', {
$dispatcher:null,
attachView: function (viewElement) {
onViewAttached: function () {
var d = this.$dispatcher;
viewElement.addEventListener('keyup', function (args) {
this.viewElement.addEventListener('keyup', function (args) {
if (args.keyCode != 13) {
return;
}
@@ -17,12 +17,6 @@
});
app.service('resultView', {
attachView: function(viewElement) {
this.viewElement = viewElement;
},
detachView: function() {
this.viewElement = null;
},
clear: function (){
this.viewElement.innerHTML = '';
},