R
R
Roma Cockenshtuff2016-03-04 20:35:01
Angular
Roma Cockenshtuff, 2016-03-04 20:35:01

How to fix $uibModalInstanse error?

<form method="POST" accept-charset="UTF-8" enctype="multipart/form-data" name="" novalidate="novalidate" class="rg-form">

</form>

I create a modal window, I pass it to another controller and the following
Unknown provider happens: $uibModalInstanceProvider <- $uibModalInstance <-reateFormController
blogApp.controller('headerController', ['$scope', '$uibModal', 'article', function($scope, $uibModal, article){
  

  $scope.$watch('csrf', function(){
    article.csrfToken = $scope.csrf;
  })


  /**
       * create an article modal 
       *
       * @param  
       * @return 
      */

  $scope.createModal = function($event){

    $event.preventDefault();

    var modalInstance = $uibModal.open({
      templateUrl: '/view/blogCreateForm.htm',
      controller: 'createFormController'
    });

    modalInstance.result.then(function(){
      // ok
    },
    function(){
      // cancel
    });
  }

}]);

//

blogApp.controller('createFormController', ['$scope', '$uibModalInstance', 'article', function($scope, $uibModalInstance, article){



}]);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arthur, 2016-03-04
@LesterTheMolester

and it was?

var blogApp = angular.module('blogApp', ['ui.bootstrap']);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question