Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dev-augmenta opened this issue Jan 21, 2016 · 1 comment

Comments

@dev-augmenta
Copy link

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
Copy link
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants