breeze

knockout.js applybindings after breeze js queries completed

a 夏天 提交于 2019-12-05 07:48:15
The question: How can I structure my code so that the knockout bindings are not applied until all of the queries for the ViewModel have been executed? Update: After some further research and experimentation I think that using something along the lines of a Deferred function may work. I have tried a few implementations, however it only defers until the query is called, rather than until all query results have been processed. I'm obviously doing something wrong here but my javascript foo is weak. Technologies used: Entity Framework 5 w/ Oracle, .Net 4 Web API, Knockout 2.2, Breeze 0.71.3 The

Mark fields not valid as red with knockout/durandal

亡梦爱人 提交于 2019-12-05 02:25:36
问题 I am learning knockout, Durandal and Breeze and thanks to the JumpStart SPA video from John Papa this is a pleasure. So I examine the code of this project and right now I am trying to change the validation mechanism. At this time, when saving changes, if the save failed, we collect the errors and display a toast with a resume of the errors. What I would like to achieve is: having the ability to mark fields not valid in red (background-color) in the view when a toast is displayed with the

Is there any AngularJS + ASP.NET-WebApi + OData + Breeze.js + Typescript examples or did someone try to combine those

陌路散爱 提交于 2019-12-05 00:30:47
问题 Im trying to combine those technologies, but nothing good comes, as entity framework meta-datas doesn't get consumed by breeze.js, even all configurations where setup, it's a bit tricky situation, there is literally no examples of that, so this is my sample code which doesn't work properly, but somehow maybe someone will find my mistake and eventually help to solve this puzzle or will find it as starting point. OdataService.ts 'use strict'; module twine.components { class MetadataStoreOptions

Exporting Importing Breeze Model and hasTempKey issues

故事扮演 提交于 2019-12-04 20:36:12
When you create a new entity Breeze set id:-1 state:'Added' hasTempKey:true. After export and re-import Breeze doesn't merge the import -1 entity with the current -1 entity in memory it adds a new one... this is explain in the docs... ( but how do we overcome this problem is the question in my case... ) So I tried to set the entity created to setUnchanged(); Now the export import cycle runs as expected but the created entity has lost it's hasTempKey:true property so newly created entity can conflict with a current one... some advice on how to resolve these issues would really be appreciated

BreezeJs with dedicated web worker

大兔子大兔子 提交于 2019-12-04 19:09:00
I am trying to initialize a Breeze manager inside a 'Web Worker'. RequireJs, knockout, q, breeze are being imported inside the worker. After a call to: EntityQuery.from('name').using(manager).execute() , the following error appears: Uncaught Error: Q is undefined. Are you missing Q.js? See https://github.com/kriskowal/q . A live preview is uploaded here http://plnkr.co/edit/meXjKa?p=preview (plunk supports downloading for easier debug). EDIT -- relevant code Worker.js importScripts('knockout.js', 'q.js', 'breeze.js', 'require.js'); define('jquery', function () { return jQuery; }); define(

Server side validation with custom EFContextProvider

廉价感情. 提交于 2019-12-04 17:16:28
After reading about Custom EFContextProvider and implementing it, I am still trying to figure out what is the best way to perform server side validation and how to apply business rule before saving...Namely my questions are revolving around 2 methods that are supposed to be overridden: protected override bool BeforeSaveEntity(EntityInfo entityInfo) { //} protected override Dictionary<Type, List<EntityInfo>> BeforeSaveEntities(Dictionary<Type, List<EntityInfo>> saveMap) { // } I am aware that docs specify that " BeforeSaveEntity method will be called for every entity before the

Isn't it dangerous to have query information in javascript using breezejs?

喜夏-厌秋 提交于 2019-12-04 15:40:39
问题 Just starting to play with breeze.js because of the obvious gains in coding time, i.e. managing to access model data from the server direct within Javascript (I am a newbie here, so obviously bare with!). In the past I have used the stock ajax calls to get/post data to the server, and I have used a few different client tools in the past to provide some help in querying local data, such as jLinq. My question is this. Isn't it dangerous to have essentially full model query access in Javascript?

Resolving breeze query/Q promise with $route resolve stops page

天涯浪子 提交于 2019-12-04 14:23:54
I'm having problems executing a breeze query with angular resolve before the view is rendered. I'm trying to get some data from the server before the view is rendered with breeze. I'm using $routeProvider.when('/countries', { templateUrl: 'App/partials/countries.html', controller: Ctrl, resolve: Ctrl.resolve }). controller and service snippets: function Ctrl($scope, Q, datacontext, countries) { //... } function getCountries(forceRefresh) { var query = entityQuery. from("countries"). orderBy("name"); return manager.executeQuery(query). then(getSucceeded); } function getSucceeded(data) { return

Breeze.js with WCF Data Service

烈酒焚心 提交于 2019-12-04 12:27:30
I just started exploring the js library, breeze.js. I've looked through the samples but can't seem to find any example on how to consume a WCF Data Service (all the examples seem to be on Web API). Does any one know how to consume a WCF Data Service (or any other OData service) with breeze.js? I read somewhere in the docs that breeze.js only supports reads for OData services at the moment. That is fine by me as the use-case I'm considering it for does not include writes to the OData Service. Jay Traband The configuration described in this answer is no longer correct! I am one of the engineers

Perform a select and expand in the same query with breeze is not supported

亡梦爱人 提交于 2019-12-04 08:37:29
I develop an asp.net solution with Durandal/breeze. Here is my code to get all my shippers: var query = EntityQuery.from('Shippers') .select('id, name, street, city'); return manager.executeQuery(query) .then(querySucceeded) .fail(queryFailed); Here is the related model: public class Shipper { [Key] public int Id { get; set; } public string Name { get; set; } public string Street { get; set; } public string Number { get; set; } public City City { get; set; } } public class City { public int Id { get; set; } public string Name { get; set; } public string PostCode { get; set; } public Country