how to resovle the error when I use the angular-popup.js Plug-ins? as the following error log
the angularjs code as the following
var app = angular.module('app', ['angular-popups']);
app.config(function (PopupProvider) {
PopupProvider.title = '提示';
PopupProvider.okValue = '确定';
PopupProvider.cancelValue = '取消';
});
app.controller('testCtrl', function($scope, Popup) {}}
the html code as the following
<div ng-controller="testCtrl">
<button type="button" class="btn btn-default" ng-click="add()">Submit</button>
</div>
错误日志信息
Error: Unknown provider: PopupProvider <- Popup
最佳答案
您的 angular.js 引用版本可能是问题所在。更新版本至1.3以上。添加 angularjs 的引用,然后添加 angular-popup.js 的引用,如下所示,
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
<script src="../dist/angular-popups.js"></script>
关于javascript - 错误: Unknown provider: PopupProvider <- Popup,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47588305/