Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 在angularjs控制器中注入toastr时出错_Css_Angularjs_Import_Alerts_Toastr - Fatal编程技术网

Css 在angularjs控制器中注入toastr时出错

Css 在angularjs控制器中注入toastr时出错,css,angularjs,import,alerts,toastr,Css,Angularjs,Import,Alerts,Toastr,嗨,我想为angular js使用toastr通知 这: 我有我的控制器和我的索引,在mi索引中,y导入所有css和js用于我的应用程序,但当我尝试将我的toastr脚本注入控制器时,控制台显示此错误 未知提供者:toastrProvider您就快到了,您没有将toastr服务注入到应用程序模块中。这显示在github上的设置中 angular.module('app',['toastr']) <!DOCTYPE html> <html> <head>

嗨,我想为angular js使用toastr通知

这:

我有我的控制器和我的索引,在mi索引中,y导入所有css和js用于我的应用程序,但当我尝试将我的toastr脚本注入控制器时,控制台显示此错误


未知提供者:toastrProvider您就快到了,您没有将
toastr
服务注入到应用程序模块中。这显示在github上的设置中

angular.module('app',['toastr'])

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" href="angular/angular-toastr/dist/angular-toastr.min.css" />

    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script src="angular/angular.min.js"></script>
    <script src="angular/angular-route/angular-route.min.js"></script>
    <script src="angular/angular-toastr/dist/angular-toastr.min.js"></script>
    <!-- <script src="resources/angular/angular-toastr/dist/angular-toastr.tpls.js"></script> also try -->



</head>

<body ng-app="app">

     <li><a href="#!client">new client</li>

    <div class="container">
        <div ng-view></div>
    </div>

    <script src="app/runConfig.js"></script>
    <script src="app/controllers/client.conroller.js"></script>
</body>
</html>
(function () {
'use stritct';

angular
    .module('app')
    .controller('clientController', clientController);

clientController.inject = ['$rootScope', '$scope', '$location', 'toastr'];

function clientController($rootScope, $scope, $location, toastr) {

}

})();