用AngularJS+bootstrap做弹窗
需要准备Angularjs,bootstrap
bootstrap下载地址
https://v3.bootcss.com/
Angularjs下载地址
https://code.angularjs.org/
引入css,路径是自己文件里的
HTML页面
mymodal.js页面
angular.module('myApp', ['ui.bootstrap']).controller('modalDemo', function ($scope, $modal, $log) {$scope.items = ['angularjs', 'backbone', 'canjs', 'Ember', 'react'];$scope.open = function (size) {var modalInstance = $modal.open({templateUrl: 'myModelContent.html',controller: 'ModalInstanceCtrl',size: size,resolve: {items: function () {return $scope.items;}}});}}).controller('ModalInstanceCtrl', function ($scope, $modalInstance, items) {$scope.items = items;$scope.ok = function () {$modalInstance.close($scope.item);};$scope.cancel = function () {$modalInstance.dismiss('cancel');}})
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
