私はモーダル(ダイアログ)を作成したいと思います。私は公式ブートストラップのドキュメンテーションの例に従ってきましたが、私は固執しました。 122おそらく未処理の拒絶::{}モーダル角は機能しません。未処理の拒否{}
メインコントローラ:
angular
.module('app')
.controller('tlmController', function($scope, $http, $timeout, $uibModal, DTOptionsBuilder, DataLoader, TestLines) {
$scope.openTestLineDetails = function(id) {
var modalInstance = $uibModal.open({
size: 'lg',
controller: 'testlineDetailsController',
templateUrl: 'app/client/layout/testlinedetails.tpl.html',
resolve: {
testLineId: function() {
return id;
}
}
});
};
})
とTestlineDetailsController:
私はモーダルを作成しようとしているとき、私はエラーにangular.min.jsを受け取ります
angular .module('app') .controller('testlineDetailsController', function($scope, $modalInstance, testLineId) { });
このコードで何が問題になっていますか?メインコントローラに$ uibModal($ modalサービスは存在しません)を使用しています。私は$ modalInstanceを$ uibModalInstanceに置き換えるとエラーが発生します(サービス$ uibModalInstanceは存在しません)ので、$ modalInstanceで$ uibModalを使用する必要があります。ストレートだが真実。
メインモジュールにui-bootstrapを注入しました – Sajeetharan
はい、var app = angular.module( 'app'、['ngRoute'、 'datatables'、 'ui.bootstrap']); –
どのバージョンのAngularとUI Bootstrapを使用していますか? – HoffZ