OSDN Git Service

Change UserInterface and File Manipulation API
[eos/base.git] / zephyr / client / app / directive / my-form / my-form.directive.js
1 'use strict';
2
3 angular.module('zephyrApp')
4 .directive('myForm', function ($compile) {
5     return {
6         template:"<div></div>",
7         scope:{ 
8             argIndex: '@j'
9         },
10         replace: true,
11         restrict: 'EA',
12         link: function (scope, element, attrs) {
13             element.append($compile("<div class=\"col-md-6\"><my-"+scope.arg.formType+"><my-"+scope.arg.formType+"/></div>")(scope));
14         },
15         controller: function($scope){
16             var argIndex  = parseInt($scope.argIndex);
17             $scope.arg = $scope.$parent.opt.arg[argIndex];
18         }
19     };
20 });