AngularJS Custom Directive based on class expression -


i attempting utilize nested custom directives produce complete survey form. custom survey tag contains repeated group tags contain repeated question tags. different question types handled separate directives based on type id. question directives elements class matches question type id.

<div ng-repeat='q in g.questions track $index' class='{{q.squt_id}}'>...</div> 

i believe problem expression being evaluated after directives applied. thoughts or ideas here? locked using type id unique way determine question types.

app.directive('1',function() {   return {     restrict: 'c',     ...   } }); 

you can create base directive, use every type , pass type id parameter. in directive can create switch, use ng-if, dynamically add type directive name in base directive template or else.

i don't think can dynamically add directive name in view.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -