@@ -13,12 +13,21 @@ function($parse, $compile, $http, $templateCache){
1313 if ( form . type === 'fieldset' ) {
1414 return 'directives/decorators/bootstrap/fieldset.html' ;
1515 }
16+ if ( form . type === 'section' ) {
17+ return 'directives/decorators/bootstrap/section.html' ;
18+ }
19+ if ( form . type === 'actions' ) {
20+ return 'directives/decorators/bootstrap/actions.html' ;
21+ }
1622 if ( form . type === 'select' ) {
1723 return 'directives/decorators/bootstrap/select.html' ;
1824 }
1925 if ( form . type === 'checkbox' ) {
2026 return 'directives/decorators/bootstrap/checkbox.html' ;
2127 }
28+ if ( form . type === 'checkboxes' ) {
29+ return 'directives/decorators/bootstrap/checkboxes.html' ;
30+ }
2231 if ( form . type === 'number' ) {
2332 return 'directives/decorators/bootstrap/default.html' ;
2433 }
@@ -46,15 +55,29 @@ function($parse, $compile, $http, $templateCache){
4655 //We do this manually since we need to bind ng-model properly and also
4756 //for fieldsets to recurse properly.
4857 $http . get ( templateUrl ( form ) , { cache : $templateCache } ) . then ( function ( res ) {
49- var template = res . data . replace ( '$ $value$$' , 'model.' + form . key ) ;
58+ var template = res . data . replace ( / \$ \ $v a l u e \$ \$ / g , 'model.' + form . key ) ;
5059 $compile ( template ) ( scope , function ( clone ) {
5160 element . replaceWith ( clone ) ;
5261 } ) ;
5362 } ) ;
5463 once ( ) ;
5564 } ) ;
56- }
5765
66+ //Keep error prone logic from the template
67+ scope . showTitle = function ( ) {
68+ return scope . form && scope . form . notitle !== true && scope . form . title ;
69+ } ;
70+
71+ scope . checkboxValuesToList = function ( values ) {
72+ var lst = [ ] ;
73+ angular . forEach ( values , function ( v , k ) {
74+ if ( v ) {
75+ lst . push ( k ) ;
76+ }
77+ } ) ;
78+ return lst ;
79+ } ;
80+ }
5881 } ;
5982} ] ) ;
6083
0 commit comments