You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, im using your wizard and it loses value of variables. Justs take 'undefined' value always. If initialize the scope variables with a default value, i'll get it but isn't dynamic. Have any suggestion? Regards.
$scope.ok = function(){
console.log($scope.hired); // ---> shows undefined.
// Same as @germg - if I initialize $scope.hired in the controller, change is not pushed from the
// template, when selecting one of the options on the radio buttons.
}
Seems like a scope issue, could this related to the directive using an isolated scope without inheriting the parent one? Not sure at this point how to make this work...I've read some references to the context object in some existing issues filed, but can't get a hold of it either.
I'm using angular 1.4.14 and the wizard directive is included in a template used by the angular bootstrap uib modal service (angular bootstrap version = 2.5.0), if that helps...
I found out that declaring the model as an object, and then using it on the templates works.
Replace data-ng-model="hired" by data-ng-model="wizard.model" in view.
And then in controller, declare/initialize a $scope.wizard = {}
Maybe it's a workaround, but if not - and it's the way we're supposed to get the values set from the template, in the controller - then seems a basic item to include in the documentation...Sorry if I missed it!
The demo does not seem to include inputs on the different steps, just navigation...maybe worth to include it there?
Activity
ibnYusrat commentedon Feb 23, 2017
Please share your code.
fcarreno commentedon Dec 5, 2017
I seem to have the same issue. Here's an example:
<wizard on-finish="ok()" hide-indicators="true"> <wz-step wz-title="job"> <h4>Prompt...</h4> <input type="radio" data-ng-model="hired" data-ng-value="true">Si</input> <input type="radio" data-ng-model="hired" data-ng-value="false">No</input> </wz-step> </wizard>$scope.ok = function(){
console.log($scope.hired); // ---> shows undefined.
// Same as @germg - if I initialize $scope.hired in the controller, change is not pushed from the
// template, when selecting one of the options on the radio buttons.
}
Seems like a scope issue, could this related to the directive using an isolated scope without inheriting the parent one? Not sure at this point how to make this work...I've read some references to the context object in some existing issues filed, but can't get a hold of it either.
I'm using angular 1.4.14 and the wizard directive is included in a template used by the angular bootstrap uib modal service (angular bootstrap version = 2.5.0), if that helps...
fcarreno commentedon Dec 5, 2017
I found out that declaring the model as an object, and then using it on the templates works.
Replace data-ng-model="hired" by data-ng-model="wizard.model" in view.
And then in controller, declare/initialize a $scope.wizard = {}
Maybe it's a workaround, but if not - and it's the way we're supposed to get the values set from the template, in the controller - then seems a basic item to include in the documentation...Sorry if I missed it!
The demo does not seem to include inputs on the different steps, just navigation...maybe worth to include it there?