Angular实现form自动布局

本文实例讲解了Angular实现form自动布局的详细代码,分享给大家供大家参考,具体内容如下

效果图:

具体代码:

1.formlayoutCtrl.js

$scope.resetForm = function(num){
console.log(num)
}
}]);

2. formlayout.html

{{title}}

3. formlayout.html

{{title}}

4. formlayoutdirective.js

\ \
',password : '
\ \
',radio : '\
\
\
',email : '\
\ \
',tel : '\
\ \
',url : '\
\ \
',number : '\
\ \
',checkbox : '
\
\
',range : '
\ ',time : '
\ ',date : '
\ ',datetime : '
\ ',search : '
\ ',select : '
\