Version problems with deprecated methods on my Breeze scripts Version problems with deprecated methods on my Breeze scripts angularjs angularjs

Version problems with deprecated methods on my Breeze scripts


The breeze library was updated and the answer is on this link: http://www.breezejs.com/documentation/breeze-angular-service

Specifically this code from the bottom of the post:

Migration is pretty painless.

  1. Remove the breeze.angular.q.js script from your project.
  2. Uninstall-Package Breeze.Angular.Q if you used NuGet.
  3. Install breeze.angular.js as explained above.
  4. Update your index.html, changing breeze.angular.q.js to breeze.angular.js.
  5. Update your app module to depend on "breeze.angular".
  6. Find the one place in your code where you call "use$q" and replace it with the "breeze" dependency.

For example, you might go from this:

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);}]);

to this:

var app = angular.module('app', [   // ... other dependencies ...   'breeze.angular']);app.run(['breeze', function () { }]);

You should also track down and eliminate code that configures Breeze to use the "backingStore" model library adapter and $http. For example, you could go from this:

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();}

to this:

function configBreeze() {    breeze.NamingConvention.camelCase.setAsDefault();


While taking the same course by John Papa I also hit breeze.core.extendQ not available on step 4.10.

This is what I did to solve the issue:

1 - In app.js pass breeze dependency directly:

// Handle routing errors and success events// Trigger breeze configurationapp.run(['$route', 'breeze', function($route, breeze){    // Include $route to kick start the router.}]);

2 - In datacontext.js do:

return EntityQuery.from('Sessions')    .select('id, title, code, speakerId, trackId, timeSlotId, roomId, level, tags')    .orderBy(orderBy)    .toType('Session')    .using(manager).execute()    .then(querySucceeded, _queryFailed);

You can also get rid of breeze.to$q.shim.js from index.html and delete the file from the \Scripts folder in the project since it's not needed anymore.


Here's the updated source code of the same project I'm doing now [ including the fixes ].