【发布时间】:2017-08-06 00:30:26
【问题描述】:
我正在使用 angularjs 1.65 版本 似乎 $sce 让我不确定 我一直在尝试 3 个小时以上的时间来修复它。
这里是模块:
var app = angular.module('myApp', ['ui.router','ngclipboard','oitozero.ngSweetAlert']);
app.config(function ($stateProvider, $urlRouterProvider, $locationProvider) {})
这里是控制器:
app.controller('monitormainController',
['$rootScope','$scope','$timeout','SweetAlert','$sce', function
($scope,$timeout,$rootScope,$watch,SweetAlert,$sce) {
$scope.copyset = function(name){ $scope.trustedHtml =
$sce.trustAsHtml(name); };
});
我收到一个错误,提示 $sce 未定义
加载资源失败:服务器响应状态为 404 (找不到文件) angular.js:14642 TypeError: 无法读取属性 未定义的“trustAsHtml” 在 Scope.$scope.copyset (monitormainController.js:93) 在 fn(编译时的评估(angular.js:15500),:4:153) 在回调(angular.js:27285) 在 Scope.$eval (angular.js:18372) 在 Scope.$apply (angular.js:18472) 在 HTMLButtonElement。 (angular.js:27290) 在 HTMLButtonElement.dispatch (jquery.js:5095) 在 HTMLButtonElement.elemData.handle (jquery.js:4766)
很高兴得到任何答复,非常感谢!
【问题讨论】:
标签: angularjs