angularjs – 我的Breeze脚本上已弃用方法的版本问题
在John Papa Pluralsight Video的教程中尝试实现会话部分时.
我收到以下错误:
(function () { 'use strict'; var app = angular.module('app',[ // Angular modules 'ngAnimate',// animations 'ngRoute',// routing 'ngSanitize',// sanitizes html bindings (ex: sidebar.js) // Custom modules 'common',// common functions,logger,spinner 'common.bootstrap',// bootstrap dialog wrapper functions // 3rd Party Modules 'ui.bootstrap',// ui-bootstrap (ex: carousel,pagination,dialog) //'breeze.angular.q' ]); // Handle routing errors and success events app.run(['$route','$rootScope','$q',function ($route,$rootScope,$q) { // Include $route to kick start the router. breeze.core.extendQ($rootScope,$q); //use$q($rootScope,$q); }]); })(); 重要的是要知道我正在处理的微风版本比原始视频上使用的版本更新. 我在breeze website上搜索了一些答案,我发现了这个:
但是我没有在教程示例中使用它.如何使用新的实现更改已弃用的实现? 更新: 这个链接帮助解决了这个问题: http://www.breezejs.com/documentation/breeze-angular-service
微风库已更新,答案在此链接:
http://www.breezejs.com/documentation/breeze-angular-service
具体来自帖子底部的代码: 迁移是非常轻松的. >从项目中删除breeze.angular.q.js脚本. 例如,你可能会这样: var app = angular.module('app',[ // ... other dependencies ... 'breeze.angular.q' // tells breeze to use $q instead of Q.js ]); app.run(['$q','use$q',function ($q,use$q) { use$q($q); }]); 对此: var app = angular.module('app',[ // ... other dependencies ... 'breeze.angular' ]); app.run(['breeze',function () { }]); 您还应该追踪并消除配置Breeze以使用“backingStore”模型库适配器和$http的代码.例如,你可以从这个: function configBreeze($q,$http,use$q) { // use $q for promises use$q($q); // use the current module's $http for ajax calls var ajax = breeze.config.initializeAdapterInstance('ajax','angular'); ajax.setHttp($http); // the native Breeze 'backingStore' works for Angular breeze.config.initializeAdapterInstance('modelLibrary','backingStore',true); breeze.NamingConvention.camelCase.setAsDefault(); } 对此: function configBreeze() { breeze.NamingConvention.camelCase.setAsDefault(); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- 如何让vim不要在字符串中添加缩进?
- angularjs – Angular UI – Bootstrap Accordion not work
- 保存退出vim编辑
- WebService到底是什么?
- 在Angular 2应用程序中使用fuse.js(typescript)
- angular – SafeValue必须使用[property] = binding,但它是
- Docker在“docker-compose”期间“优雅地停止”自己但不是“
- Bootstrap(2)排版(简练版)
- 基于Axis2开发WebService代码详解
- windows-7 – Docker:当试图运行docker run hello-world