Created
August 7, 2015 12:50
-
-
Save kis/ab43b8889d8f7345df30 to your computer and use it in GitHub Desktop.
This file contains 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
(function() { | |
'use strict'; | |
angular | |
.module('uaMain') | |
.directive('essaysEdit', essaysEdit); | |
/** @ngInject */ | |
function essaysEdit($sce) { | |
var directive = { | |
restrict: 'E', | |
templateUrl: 'app/pages/athlete/tabs/essays/essays-edit.html', | |
scope: { | |
essayItem: '=' | |
}, | |
link: linkFunc | |
}; | |
return directive; | |
function linkFunc(scope, elem, attrs, vm) { | |
scope.essayItem = $sce.trustAsHtml(scope.essayItem); | |
scope.initialEssayItem = angular.copy(scope.essayItem); | |
scope.isEdit = false; | |
scope.edit = function() { | |
scope.isEdit = true; | |
} | |
scope.save = function() { | |
scope.initialEssayItem = angular.copy(scope.essayItem); | |
scope.isEdit = false; | |
//service save | |
} | |
scope.close = function() { | |
scope.essayItem = angular.copy(scope.initialEssayItem); | |
scope.isEdit = false; | |
} | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment