I'm trying to use AngularJS and BootStrap to display the modal screen.
Now $modal.open
TypeError Cannot read property 'open' undefined
I get an error.
What is the cause?
var app=angular.module('app', ['ui.bootstrap']);
// ApplicationController
app.controller("controller", ['$scope', '$http', function($scope, $http, $modal)
{
$scope.AnkenCheck=function(){
$scope.newGuest={};
$modal.open({
templateUrl: "AnkenSurch",
scope —$scope
}); }
}]);
Overall, it was $uimodal instead of $modal
First of all,
app.controller("controller", ['$scope', '$http', '$uibModal', function($scope, $http, $uibModal)
I understand that it is necessary to define it as .
When you actually use it
varmodalInstance=$uibModal.open({
templateUrl: "AnkenSurch",
scope —$scope
});
Yes
© 2024 OneMinuteCode. All rights reserved.