loopback-component-admin
loopback-component-admin copied to clipboard
Type issue
I am getting an error when starting the admin panel ,in the console.
no such type defined for ObjectID Object {type: "ObjectID"}
this is happening in angular.js:13003.. and found that not registering the type of ObjectId with the config provider.
Could you please let me know how can i register that so that it will render every thing properly.?
it is actually here..
if (_propertyTypes[property.type.toLowerCase()]) { -- > cannot find it in propoertyTypes _this.propertyNames.push(propertyName); propertyConstructor = $injector.get(_propertyTypes[property.type.toLowerCase()]); return _this.properties.push(new propertyConstructor(propertyName, property)); } else { return $log.warn('no such type defined for', property.type, property); }
https://github.com/BoLaMN/loopback-component-admin/commit/eb49c6e19618fd5906519121e7a6f77a8ebdb988
should fix the warning message, ill try get around to compiling it and publishing.
theres still a bit of work todo around types and relations as i have to figure out how they should display in a table and a form view thats universal enough to handle it.
Ahh, it is not just the warning , but none of my custom models data is been loaded - actually the resources are not been called at all.. there is some error
TypeError: resource is not a function
at new
TypeError: resource is not a function at new (loopback-admin.js:2085)
points to the factories not being avaliable that get generated by loopback-sdk-angular any warnings in the console?
no warnings in the console.. and the factories are available..
TypeError: resource is not a function
is looking at https://github.com/BoLaMN/loopback-component-admin/blob/master/src/client/components/data/model.factory.coffee#L17 and the loopback injector is just checking for the factory and returning it https://github.com/BoLaMN/loopback-component-admin/blob/571b555dced70abaa480c03b2da9719100d94f24/src/client/components/common/factories/loopback-injector.coffee
so the only way it would not be a function if it didnt exist? do your model names conform too loopbacks Upper Camel Case (PascalCase) as i know i had issues when i tried to go against the normal with loopback-sdk-angular

The model names confirm to the PascalCase and it is not very complex .. makes me wonder
Following up by changing the toLowerCase call in two places there .. i hit another wall
Error: [$injector:unpr] Unknown provider: StringPropertyProvider <- StringProperty http://errors.angularjs.org/1.5.0-rc.0/$injector/unpr?p0=StringPropertyProvider%20%3C-%20StringProperty
ahh yeah its supposed to be lower case, not infront of my mac so couldnt test it and iphone github isnt the easiest either ;)
ive updated that part. its only a warning thou it shouldnt be stopping the ui from working.
try doing in the console var admin = angular.element(document.querySelector('html')).injector().get('LoopBackAdminConfiguration')
then console.log(admin.models);
which should show you whats registered
you can check out the xhr request for the config.json to the api server aswell which holds what models it loads and the xhr request to loopback-admin.resources.js is what the loopback-angular-sdk has generated, can you check them models exist in both locations?
all the models are getting registered..
Really appreciate your quick response.. but if i can fix all the issues, it will be really helpful for me.. :)
Odd so on that page clicking the plus button doesn't work but gives that resource isn't a function error? Does it work on the main dashboard view maybe?
Its also odd that the route has the model being all lowercase where it maybe should be pascal cased
well can the problem because i dont have a plural form defined ?