Repository navigation
Conversation
|
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test." |
|
@janhapke Thanks for your contribution! yes we havent published the option to npm yet :(, for dev purposes, you can use
as for creating the model, perhaps you could try something like https://github.com/strongloop/loopback-sdk-angular-cli/blob/master/test/fixtures/async-app/boot/boot.js
cc/ @bajtos |
|
Can one of the admins verify this patch? |
|
@slnode ok to test |
|
|
||
| console.error('Generating %j for the API endpoint %j', ngModuleName, apiUrl); | ||
| var result = generator.services(app, ngModuleName, apiUrl); | ||
| var result = generator.services(app, {ngModuleName: ngModuleName, apiUrl: apiUrl, includeSchema: includeSchema}); |
There was a problem hiding this comment.
please split the options argument on multiple lines:
generator.services(app, {
// ...
});|
this will also close duplicate PR #34 |
|
@bajtos thank you for your feedback, I have implemented your suggestions. However the created models are still not properly returned by the rest handlers get classes method (which is used to generate the schema), so I left a portion of the hack in the test fixture. |
|
@janhapke what Node version are you using? I found that when running on Node v6, the output of lb-ng gets trimmed. The You can check this by running the following command: Here is my // Copyright IBM Corp. 2014,2015. All Rights Reserved.
// Node module: loopback-sdk-angular-cli
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
var loopback = require('loopback');
var app = loopback();
app.set('restApiRoot', '/rest-api-root');
app.dataSource('db', { connector: 'memory' });
var TestModel = app.registry.createModel(
'TestModel',
{ foobaz: 'string' }
);
app.model(TestModel, { dataSource: 'db' });
module.exports = app; |
|
I asked @davidcheung to look into this problem. We should fix it in a standalone pull request out of scope of your work here, @janhapke. |
|
Loosely related #45 |
|
Now that #45 fixed the problem of trimmed CLI output, I think it's time to resume work on this patch. @janhapke could you please rebase your patch on top of the latest master and fix the fixture app per my #43 (comment)? |
|
Closing in favour of #55 |
I noticed that an option 'includeSchema' was recently added to loopback-sdk-angular and I needed this feature in lb-ng. I added a new flag '-s' that passes this option.
However, I had some issues while implementing this:
I still hope the pull request is useful and maybe somebody can point out a solution for the proper way to inject testing models.