DigitalMachinist / loopback-angular-ui-router

A starter pack for creating websites hosting a LoopBack REST API presented using an AngularJS and Bootstrap (CSS) frontend.
MIT License
8 stars 4 forks source link

Cannot find a model when generating angular classes with grunt or lb-ng #5

Open dev-augmenta opened 8 years ago

dev-augmenta commented 8 years ago

I started to customized the scaffold project adding loopback-component-passport and a basic user authentication system (I've already done directly in loopback and it works).

I added a new model in /common/models/user-credential.json like so

{ "name": "userCredential", "plural": "userCredentials", "base": "UserCredential", "properties": {}, "validations": [], "relations": { "user": { "type": "belongsTo", "model": "AppUser", "foreignKey": "userId" } }, "acls": [], "methods": {} }

and updated model-config.json like so

{ "_meta": { "sources": [ "loopback/common/models", "loopback/server/models", "../common/models", "./models", "./node_modules/loopback-component-passport/lib/models" ], "mixins": [ "loopback/common/mixins", "loopback/server/mixins", "../common/mixins", "./mixins" ] }, "userCredential": { "dataSource": "db", "public": false },....

Even if the new "sources" field for passport is correctly defined when launching grunt or lb-ng I get an error that userCredential cannot be found.....

Any hint?

DigitalMachinist commented 8 years ago

@dev-augmenta

I'm not able to reproduce this one. I feel like there's more to this configuration than just an npm i loopback-component-passport. Have you included any other packages or introduced any other code?

By simply scaffolding and adding this code to the common models I'm not experiencing any errors, but I'm not seeing any new functionality either, so I must be missing something.