janhommes / o.js

o.js - client side oData lib.
https://janhommes.github.io/o.js/example/
MIT License
238 stars 57 forks source link

Q dependence is missing in bower.json #35

Closed mindej closed 8 years ago

mindej commented 8 years ago

I have a project set up using Bower: "o.js": "0.2.2" While executing examples i get an error because defer dependency is not defined:


o('http://services.odata.org/V4/OData/OData.svc/Products').find(':0').route('Product/Detail/:0/:1',function(data) {
  console.log('Route Product/Detail/'+this.param[0]+'/'+this.param[1]+' triggered. Result:');
  console.log(data);
});
t {data: Array[0], inlinecount: null, param: Object, oConfig: Object}any: (e,n)arguments: nullcaller: nulllength: 2name: ""prototype: Object__proto__: ()<function scope>batch: (e)arguments: nullcaller: nulllength: 1name: ""prototype: Object__proto__: ()<function scope>beforeRouting: (e)arguments: nullcaller: nulllength: 1name: ""prototype: Object__proto__: ()<function scope>count: ()data: Array[0]length: 0__proto__: Array[0]delete: (e)arguments: nullcaller: nulllength: 1name: ""prototype: Object__proto__: ()<function scope>deleteRef: (e,n)arguments: nullcaller: nulllength: 2name: ""prototype: Object__proto__: ()<function scope>exclude: (e,n)arguments: nullcaller: nulllength: 2name: ""prototype: Object__proto__: ()<function scope>expand: (e)arguments: nullcaller: nulllength: 1name: ""prototype: Object__proto__: ()<function scope>filter: (e)arguments: nullcaller: nulllength: 1name: ""prototype: Object__proto__: ()<function scope>filterByList: (e,n)find: (e)first: ()get: (e,n)include: (e,n)inlineCount: (e)inlinecount: nullisEndpoint: ()link: (e,n)loading: (e,n)oConfig: Objectappending: ""endpoint: nullerror: nullformat: "json"headers: Array[0]isAsync: trueisCors: trueisHashRoute: trueopenAjaxRequests: 0password: nullready: nullstart: nullstrictMode: trueusername: nullversion: 4__proto__: ObjectorderBy: (e,n)arguments: nullcaller: nulllength: 2name: ""prototype: Object__proto__: ()<function scope>orderByDesc: (e)arguments: nullcaller: nulllength: 1name: ""prototype: Object__proto__: ()<function scope>param: Object__proto__: Objectpatch: (e,n)arguments: nullcaller: nulllength: 2name: ""prototype: Object__proto__: ()<function scope>post: (e,n)progress: (e)put: (e,n)query: (e)arguments: nullcaller: nulllength: 1name: ""prototype: Object__proto__: ()<function scope>ref: (e,n)remove: (e)removeRef: (e,n)route: (e,n)routes: (e,n)save: (e,n)search: (e,n,t,r)select: (e)skip: (e)take: (e)top: (e)triggerRoute: (e)where: (e)__proto__: Object
var oHandler = o('http://services.odata.org/V4/OData/OData.svc/Products');
undefined
oHandler.find(1);
t {data: Array[0], inlinecount: null, param: Object, oConfig: Object}any: (e,n)batch: (e)beforeRouting: (e)count: ()data: Array[0]delete: (e)deleteRef: (e,n)exclude: (e,n)expand: (e)filter: (e)filterByList: (e,n)find: (e)first: ()get: (e,n)include: (e,n)inlineCount: (e)inlinecount: nullisEndpoint: ()link: (e,n)loading: (e,n)oConfig: ObjectorderBy: (e,n)orderByDesc: (e)param: Objectpatch: (e,n)post: (e,n)progress: (e)put: (e,n)query: (e)ref: (e,n)remove: (e)removeRef: (e,n)route: (e,n)routes: (e,n)save: (e,n)search: (e,n,t,r)select: (e)skip: (e)take: (e)top: (e)triggerRoute: (e)where: (e)__proto__: Object
oHandler.get(function(data) {
  console.log(data);
  //or the saved var also contains the data:
  console.log(oHandler.data);
});
o.min.js:1 Uncaught TypeError: Cannot read property 'defer' of null(…)G.get @ o.min.js:1(anonymous function) @ VM5133:1
janhommes commented 8 years ago

see #33, will fix there