search

Home  >  Q&A  >  body text

angular.js - angular模块config路由时,引入$sce服务出错

$sce在哪个模块里啊
为什么在config路由的时候想注入它出错啊:
Uncaught Error: [$injector:modulerr]

angular.module('marketing-module',['ngRoute','d3','ngSanitize'])
    .config(['$routeProvider','$sce',function($routeProvider,$sce){
        $routeProvider
            .when('/',{
                ...
            })
            ...;
 }]);
世界只因有你世界只因有你2743 days ago586

reply all(2)I'll reply

  • 迷茫

    迷茫2017-05-15 16:53:57

    Only things like constant provider can be injected into config, but service cannot be injected

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-15 16:53:57

    Solved it myself. Services cannot be introduced here, only service providers

    reply
    0
  • Cancelreply