Angular - $ uibModal undefined

I created this controller

app.controller('headerCtrl', [
    '$scope', '$log', '$uibModal',  function($scope, $log, $uibModal){...}])

which gives the following error anytime I run it

Unknown provider: $uibModalProvider <- $uibModal <- headerCtrl

According to angular, this could be due to a clause with the name of dependencies or undefined dependencies, which is not the case here, since ui.bootstrap is defined and correctly spelled

Here is my module

var app = angular.module('app', [
  'ngMap',
  'ui.router',
  'ui.bootstrap',
  'ngSanitize',
  'ngAnimate'
]);

However, when I remove '$ uibModal' before a function like this

app.controller('headerCtrl', [
    '$scope', '$log', function($scope, $log, $uibModal){...}])

and run

console.log($uibModal)
Console

returns undefined. I updated ui-bootstrap with a gazebo, but that didn't work. Because of this, I could not create a modal. How to get $ uibModal for a successful injection using angular

+4
source share

Source: https://habr.com/ru/post/1628726/


All Articles