/** * Created by NICK on 15/12/3. * email:nick121212@126.com * qq:289412378 * copyright NICK */ import ref = require('ref'); //var json = require('../../node_modules/jsoneditor/dist/jsoneditor'); export class Directive { public static _name:string = "schemaEdit"; public static directive:Array = [()=> { var dir:ng.IDirective = { //compile?: IDirectiveCompileFn; //controller?: any; //controllerAs?: string; //bindToController?: boolean|Object; //link?: IDirectiveLinkFn | IDirectivePrePost; //name?: string; //priority?: number; //replace?: boolean; //require?: any; //restrict?: string; //scope?: any; //template?: any; //templateUrl?: any; //terminal?: boolean; //transclude?: any; restrict: 'EA', replace: false, scope: { json: '=' }, link: ($scope, $element, $attrs)=> { var _this = $scope; _this['editor'] = new JSONEditor($element[0]); $scope.$watch($attrs['json'], ()=> { _this['editor'].set($scope['json']); }); } }; return dir; }]; }