我有這樣的嵌套狀態:已經從解決所謂如何在角度上克隆對象?
.state("inspectionsBuilder.view", {
url: "/:inspectionId",
templateUrl: "app/inspectionsBuilder/templates/inspectionsBuilder.tmpl.html",
controller: "inspectionsBuilderController",
controllerAs: "builder",
resolve: {
inspectionCurrentIFrame: ["getCurrentIFrameService", inspectionGetCurrentListIFrameResolver]
},
})
這裏是功能:
function inspectionGetCurrentListIFrameResolver(getCurrentIFrameService) {
return getCurrentIFrameService;
}
getCurrentIFrameService - 是廠家售後服務返回一些DOM元素。
從inspectionGetCurrentListIFrameResolver函數我想克隆getCurrentIFrameService服務並返回它。
function inspectionGetCurrentListIFrameResolver(getCurrentIFrameService) {
var elem = null;
var result = angular.copy(getCurrentIFrameService,elem);
return elem;
}
但它不工作。任何想法我失蹤?
任何例子將是有益的? – Michael