Skip to content

Check if include-schema argument provided and pass option to generator #34

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions bin/lb-ng
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ var argv = optimist
.describe('m', 'The name for generated Angular module.')
.default('m', 'lbServices')
.describe('u', 'URL of the REST API end-point')
.alias({ u : 'url', m: 'module-name' })
.describe('s', 'Include model schema definition')
.alias({ u : 'url', m: 'module-name', s: 'include-schema' })
.demand(1)
.argv;

Expand All @@ -26,9 +27,10 @@ assertLoopBackVersion();

var ngModuleName = argv['module-name'] || 'lbServices';
var apiUrl = argv['url'] || app.get('restApiRoot') || '/api';
var includeSchemas = argv['include-schema'];

console.error('Generating %j for the API endpoint %j', ngModuleName, apiUrl);
var result = generator.services(app, ngModuleName, apiUrl);
console.error('Generating %j for the API endpoint %j', ngModuleName, apiUrl, includeSchemas);
var result = generator.services(app, ngModuleName, apiUrl, includeSchemas);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akera-io Could you please rework this line to use the new options-based API introduced in strongloop/loopback-sdk-angular#223?


if (outputFile) {
outputFile = path.resolve(outputFile);
Expand Down