Answer the question
In order to leave comments, you need to log in
ng-transclude template load event, to include a script?
Setting up the Angular-Wizard module ( https://github.com/mgonto/angular-wizard )
It includes directives. They are used to load the template.
I use the module to create a multi-step form. Everything works great.
But the only caveat. When the page is loaded, the wizard directives pull up their template. Since I'm using it to create forms, I need to include an input mask.
<form id="s_add_agent_form" class="uk-form-stacked">
<wizard on-finish="finishedWizard()" template="app/templates/wizard.tpl.html">
<wz-step title="1" template="app/templates/wizard.step.tpl.html">
<label for="user_phone1">Телефон</label>
<input data-inputmask="'mask': '+7 (999) 999 99 99'" data-inputmask-showmaskonhover="false" type="text" class="masked_input md-input" name="user_phone1" id="user_phone1" md-input ng-model="s_user_data.step1.user_phone1" />
</wz-step>
<wz-step title="2" template="app/templates/wizard.step.tpl.html">
<label for="user_phone2">Доп. телефон</label>
<input data-inputmask="'mask': '+7 (999) 999 99 99'" data-inputmask-showmaskonhover="false" type="text" class="masked_input md-input" name="user_phone2" id="user_phone2" md-input ng-model="s_user_data.step1.user_phone2" />
</wz-step>
<wz-step title="3" template="app/templates/wizard.step.tpl.html">
<label for="user_phone3">Доп. телефон</label>
<input data-inputmask="'mask': '+7 (999) 999 99 99'" data-inputmask-showmaskonhover="false" type="text" class="masked_input md-input" name="user_phone3" id="user_phone3" md-input ng-model="s_user_data.step1.user_phone2" />
</wz-step>
</wizard>
</form>
<div class="wizard">
<div class="steps uk-clearfix">
<ul ng-if="!hideIndicators" class="uk-clearfix">
<li ng-class="{ default: !step.completed && !step.selected, current: step.selected && !step.completed, done: step.completed && !step.selected, editing: step.selected && step.completed, last: $last}" ng-repeat="step in getEnabledSteps()">
<a ng-click="goTo(step)">
<span class="number">{{$index+1}}</span>
<span class="title">{{step.title || step.wzTitle}}</span>
</a>
</li>
</ul>
</div>
<div class="content" ng-transclude></div>
</div>
<section ng-show="selected" ng-class="{current: selected, done: completed}" class="step body" ng-transclude>
</section>
$maskedInput = $('.masked_input');
if($maskedInput.length) {
$maskedInput.inputmask();
}
$timeout(function(){
$maskedInput = $('.masked_input');
if($maskedInput.length) {
$maskedInput.inputmask();
}
}, 1);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question