0

Environment: vwd 2013, project template : hot towel angular 1.3, breeze, entity-framework ado .net 6.0, sql server 2012 express, breeze web.api2.

I 've developped a spa web site with these technologies. Everything works fine, except when I do a $window.location.reload(), it seems to empty the metadatastore of breeze, and the first page displayed after the reload() is not correctly bound (not bound at all).

I would like to know if it's possible to handle the metadatastore, ideally at the instanciation of the entityManager of breeze, from the client-side.

For the moment, the metadatastore is handled automatically, fed from the Metadata method of the BreezeController on the server-side.

On debug mode, I can see that the Metadata method, is often called, maybe too often.

After searching in the sources of the web app, I can see in breeze.debug.js, the function ctor.prototype.fetchMetadata = function (metadataStore, dataService) calling the Metadata method. This fetchMetadata function seems to be called from breeze.angular.q.js.

I wouldn't like to touch to these javascript.

I would like to do this (is this possible ?):

- deactivate the Metadata method of the BreezeController.
- Write a GetMetadata method in the BreezeController, doing the same thing that Metadata.
- Call this new method GetMetadata on the client-side when I do a new breezeEntityManager.

Without modifying the javascripts given with the poject template hot towel angular, is it possible ?

Thanx for your help.

fguigui
  • 294
  • 1
  • 4
  • 11
  • When you do a full page reload you are blowing up all 'cached' JavaScript, not just Breeze's metadata, so that is by default. If you are using Angular you should be able to defer the router until your metadata has returned using a promise. – PW Kad May 05 '14 at 19:19
  • PW Kad I can't manage to do what you say, I've seen post such as http://stackoverflow.com/questions/11972026/delaying-angularjs-route-change-until-model-loaded-to-prevent-flicker Actually this bug appears when I have decided to executeLocally Breeze queries. In my config.route.js, I try to do this : routes.forEach(function (r) { $routeProvider.when(r.url, r.config, {resolve: extendBreezeWith_to$q}) How to defer the router after fetchMetadata ? – fguigui May 08 '14 at 15:19

0 Answers0