troch / angular-multi-step-form

An angular module for creating multi step forms / wizards
http://troch.github.io/angular-multi-step-form
ISC License
144 stars 44 forks source link

How to inject nextStep programatically? #63

Closed madhuvuvaddi closed 7 years ago

madhuvuvaddi commented 8 years ago

angular

.module('App', [ 'ngAnimate', 'ngRoute', 'ui.bootstrap', 'hljs','ngSanitize', 'multiStepForm' ])

.config([ '$routeProvider', function($routeProvider) {

$routeProvider.when('/home', {
    templateUrl : 'views/home.html',
    reloadOnSearch : false
// controller: ''
}).when('/ps-mfsubscriber', {
    controller : 'multiStepController',
    templateUrl : 'views/multistepnav.html',
    reloadOnSearch : false,
    steps : [{....}}]
    .controller('multiStepController',
    [ '$scope', '$location', '$route', function($scope, $location, $route) {

        $scope.model = {};

        $scope.steps = $route.current.$$route.steps;
        $scope.steps2 = $route.current.$$route.steps2;

        $scope.submit = function(){
            $scope.$nextStep();
        }

button is within step controller still getting some $scope.$nextStep is not a function

troch commented 8 years ago

<multi-step-form> creates its own scope, and your controller multiStepController is not the directive / form steps controller.