Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.module.directive('defaultRowTemplate', function() {
- return {
- scope: {
- rowValue: '=',
- rowKey: '=',
- edit: '&'
- },
- replace: true,
- template: "<div class=\"col-sm-10\" >\n <input type=\"text\" ng-disabled=\"rowKey == 'Id'\" class=\"form-control\" id=\"{{rowKey}}\" ng-value=\"rowValue\">\n</div>",
- link: function($scope, $element, $attrs) {
- return $('input', $element).keyup(function(e) {
- if (e.which === 13) {
- return $scope.edit()($scope.rowKey, $scope.rowValue);
- }
- });
- }
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement