Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upwz-next="function", function is never executed #148
Comments
|
Additionally it appears that wz-next cancels out ng-click methods |
|
I don't like it but I went with the following solution while hoping for a more angularly way of solving my problem: var app = angular.module('mydhWizard', ['mgo-angular-wizard']);
app.controller('WizardCtrl', function($scope, WizardHandler) {
$scope.finished = function() {
alert("Wizard finished :)");
};
$scope.logStep = function() {
console.log("Step continued");
};
$scope.goBack = function() {
WizardHandler.wizard().goTo(0);
};
$scope.setQuestionaire = function(num) {
console.log(num);
WizardHandler.wizard().next();
};
});
app.controller('WizardUseCaseCtrl', function($scope, $rootScope, WizardHandler) {
var purposes = [
"develop a new application in the cloud",
"migrate an existing application to the cloud",
"create a failover environement for my existing application",
"create a cloud environment for development and testing",
"create a cloud storage location for new or existing data",
"archive data to long term or infrequently-accessed offsite storage",
"create a disaster recovery environment",
];
$scope.setQuestionaire = function(num, p) {
$rootScope.wizard_cloud_purpose = "I want to " + purposes[p];
$rootScope.wizard_questionaire = num;
WizardHandler.wizard().next();
};
}); |
|
Looking into this |
|
Also see #113 |
|
@morissette I just pulled everything down and tested it out. Using this syntax: <button wz-next="myFunction()">Click Me</button>myFunction is called. Also adding an ngClick to this button also calls the ngClick method, however it would be very bad practice to do this, especially if timing matters. I would assume that your problem lies in the scope of your Closing the issue, will re open if you have further questions |
Description:
I am showing no execution of any function passed to wz-next, either in $scope.function or traditional function func() declarations. Both are simple functions that just log to the console yet nothing is logged.
Angular: 1.4.6
Javascript, controller and module:
View and directive: