Views unbinding

This commit is contained in:
Borys Levytskyi
2015-04-03 00:38:50 +03:00
parent e1963fb09c
commit 72f9d0bb4e
4 changed files with 147 additions and 76 deletions

View File

@@ -1,6 +1,7 @@
(function(app){
app.controller('expressionInputCtrl', {
bindView: function (viewElement) {
attachView: function (viewElement) {
var dispatcher = app.service('dispatcher');
viewElement.addEventListener('keyup', function (args) {
if (args.keyCode != 13) {
@@ -15,9 +16,12 @@
});
app.service('resultView', {
bindView: function(viewElement) {
attachView: function(viewElement) {
this.viewElement = viewElement;
},
detachView: function() {
this.viewElement == null;
},
clear: function (){
this.viewElement.innerHTML = '';
},