-
Notifications
You must be signed in to change notification settings - Fork 82
Describe model schema in generated $resource #223
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
Conversation
* @description | ||
* The schema of the model represented by this $resource | ||
*/ | ||
R.schema = <%- JSON.stringify(meta.modelSchema, null, 2) -%>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be better to use <%-: meta.modelSchema | q %>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, will apply your proposal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, on the second thought, I think it's better to explicitly call JSON.stringify
here. The intention of the q
filter is to produce a quoted string. The fact that it calls JSON.stringify under the hood is an implementation detail that we should not rely on, as it may change in the future (in theory).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, make sense
Please note that this should be landed with strongloop/loopback-sdk-angular-cli#34 using options since angular-sdk-cli isnt using loopback-sdk-angular/lib/services.js Line 45 in 61b3641
https://github.com/akera-io/loopback-sdk-angular-cli/blob/a5979f765710e4b96b46922d61da1f0c716fcbad/bin/lb-ng#L33 placeholder for link to documentation once landed |
@bajtos other than comments above LGTM |
I was careful to preserve support for old API loopback-sdk-angular/lib/services.js Lines 46 to 52 in 61b3641
|
right, all the tests are passing too
|
generateServices(app, options)
to tame overgrowing number of arguments.This patch supersedes #194.
/to @davidcheung please review
/cc @akera-io