是否可以在运行期间注入示波器或控制器?或任何其他建议动态地将服务注入控制器?
Application.controller('IndexController', function($scope){
// some actions
if(someconditions) {
$scope.$inject = [someServiceName];
// and here i want to use service methods
}
});
Run Code Online (Sandbox Code Playgroud)
提前致谢