Addi Khan Addi Khan -4 years ago 129
AngularJS Question

how to add $model for show pop html angularjs

i am using below angularjs library in my project... i want to and $model its show error why i don't know

https://ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular.min.js

below code does not run.. please help me

var app = angular.module('myApp', []);
app.controller('myCtrl', ['$scope', '$filter', '$modal', function ($scope, $filter,$modal) {
$scope.moreinformation = function (item) {
console.log('opening pop up');
var modalInstance = $modal.open({
templateUrl: 'popup.html',
controller: 'myCtrl',
});
}

}]);


enter image description here

Answer Source

$modal is a service included in UI Bootstrap, it is not a part of official angular library.

To use $modal, you have to include ui bootstrap in your page, then add it as your app dependency:

angular.module('myModule', ['ui.bootstrap']);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download