Giter Site home page Giter Site logo

loopback-sdk-angular-cli's Introduction

loopback-sdk-angular-cli

⚠️ LoopBack 3 is in Maintenance LTS mode, only critical bugs and critical security fixes will be provided. (See Module Long Term Support Policy below.)

We urge all LoopBack 3 users to migrate their applications to LoopBack 4 as soon as possible. Refer to our Migration Guide for more information on how to upgrade.

Overview

CLI tools for the LoopBack AngularJS SDK.

See the official LoopBack AngularJS SDK documentation for more information.

Mailing List

Discuss features and ask questions on LoopBack Forum.

Module Long Term Support Policy

This module adopts the Module Long Term Support (LTS) policy, with the following End Of Life (EOL) dates:

Version Status Published EOL
3.x Maintenance LTS Feb 2017 Dec 2020
2.x End-of-Life Dec 2015 Apr 2019

Learn more about our LTS plan in the docs.

loopback-sdk-angular-cli's People

Contributors

0candy avatar amir-61 avatar bajtos avatar candytangnb avatar davidcheung avatar dhmlau avatar gunjpan avatar jannyhou avatar kallenboone avatar rmg avatar sam-github avatar siddhipai avatar superkhau avatar traksewt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

loopback-sdk-angular-cli's Issues

Expected response to contain an object but got an array

I have 2 models game & salesItem

game hasMany salesItem, salesItem belongsTo game, which will auto gen /games/:id/salesItem

When I generate and use lb-services.js It says "Expected response to contain an object but got an array" when I try to request to Game.salesItem.findById({id: }).

Currently I managed to temporary fixed by editing the lb-services.js on "::findById::game::salesItem": { section to include isArray: true, but it think its the lb-ng bug?

Fix lb-ng to support async app boot

We recently added a Loopback boot script that is async, by adding the optional 2nd callback parameter. We did this in order to serially execute some async operations that we have taking place during boot.

Once we did this, two things happened,

  1. Our mixins also started loading async.
  2. Our lb-ng command no longer generates a correct client lib - it does not wait for the async boot process, so anything that occurs in the async code (including code from our model mixins that initializes relations, etc) does not execute prior to the client lib generating the libraries.

lb-ng and nodemon

Using nodemon to check for changes in the model, and regenerate the lb-service file,
in previous versions work fine, but now lb-ng runs another server.js instance

ng-annotate breaks generated lbServices

There is a diff in the service names and their annotations in the generated angular code:

module.factory(
  "User",
  ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) {
    var R = Resource(
      urlBase + "/Users/:id",
      { 'id': '@id' },
      {
/// abbreviated for clarity

The service being called in the function parameter is Resource, but it's actual name is LoopBackResource.

The annotation will get replaced by ng-annotate when we run our gulp tasks. thus breaking the module, and causing angular to be unable to find the service, since it's looking for Resource rather than LoopBackResource.

Use strong-docs instead of Docular

Docular, the module we are using for rendering API docs for the generated code, is seriously broken. It requires write permissions to global modules folder and quite often does not work on windows.

I am proposing to rework lb-ng-doc to use strong-doc, which can already parse and process ngdoc-style of comments.

Tasks:

  • Open-source strong-docs
  • Rework lb-ng-doc

Support for Angular2

Related with issue on loopback-sdk-angular module.

Command line module must be changed too for suporting command format, what proposed JonnyBGod

I think it is good idea to use current format with option -l for generation of code for Angular2:

lb-ng ./server/server.js ./client/src/app/lb-services.ts -l angular2

Polymorphic relations

It seems as though lb-ng is having trouble with polymorphic relations. It echoes:

Warning: scope Picture.imageable is missing _targetClass property. The Angular code for this scope won't be generated. Please upgrade to the latest version of loopback-datasource-juggler to fix the problem.

Updating loopback-datasource-juggler does not fix the problem, incidentally.

upsert to postgressql causes TypeError: Object.keys called on non-object

node_modules/loopback-datasource-juggler/lib/model.js:134
var keys = Object.keys(data);
^
TypeError: Object.keys called on non-object
at Function.keys (native)
at ModelConstructor.ModelBaseClass._initProperties (/home/bruno/web/representante.co/api/node_modules/loopback-datasource-juggler/lib/model.js:134:21)
at /home/bruno/web/representante.co/api/node_modules/loopback-datasource-juggler/lib/dao.js:286:14
at /home/bruno/web/representante.co/api/node_modules/loopback-connector-postgresql/lib/postgresql.js:334:5
at null.callback (/home/bruno/web/representante.co/api/node_modules/loopback-connector-postgresql/lib/postgresql.js:143:5)
at Query.handleReadyForQuery (/home/bruno/web/representante.co/api/node_modules/loopback-connector-postgresql/node_modules/pg.js/lib/query.js:82:10)
at null. (/home/bruno/web/representante.co/api/node_modules/loopback-connector-postgresql/node_modules/pg.js/lib/client.js:159:19)
at emit (events.js:117:20)
at Socket. (/home/bruno/web/representante.co/api/node_modules/loopback-connector-postgresql/node_modules/pg.js/lib/connection.js:109:12)
at Socket.emit (events.js:95:17)

timeout in generated services for angularjs

Hi there,

When I generate AngularJS SDK for my LB API, it generates the following code for each API method (login is an example below)

"login": { params: { include: "user" }, interceptor: { response: function(response) { var accessToken = response.data; LoopBackAuth.setUser(accessToken.id, accessToken.userId, accessToken.user); LoopBackAuth.rememberMe = response.config.params.rememberMe !== false; LoopBackAuth.save(); return response.resource; } }, url: urlBase + "/Members/login", method: "POST" },

In an event of a server failure or when server is unreachable, the code never returns a response/error. I believe you need to include timeouts in generated code.
Any thoughts?

not able to generate all the models

The folder contains all different type of models, including database and the local storage. lb-ng doesnt generator appropriate models in the lb-services-s.js from the commend. Are there any fixes from such issues? The issue is at version of the loopback system which runs on v3.0.0-beta. Im currently looking for a way to make lb-ng generator to works with the latest loopback. @bajtos @davidcheung @pthieu

So i just tried to reinstall lb-ng again with the latest version. It got that working but no responses to me. When does the latest 3.0.0 cli release? our roadmap is stuck on this thing now..

Forked project can't run tests.

I forked this project because I want to add the ability to add another parameter to the command $ lb-ng ./app.js ./js/lb-services.js so that I can have the base url set to a different url completely rather than it just being set to /api.

I'm following the instructions in https://github.com/strongloop/loopback-angular-cli/blob/master/CONTRIBUTING.md#how-to-contribute and I get the errors below when trying to run both jshint . and npm test.

Please advise as to how I can run jshint and npm test without errors.

$ jshint .
'jshint' is not recognized as an internal or external command,
operable program or batch file.
$ npm test

> [email protected] pretest C:\Users\m089269\WebstormProjects\loopback-angular-cli
> jshint .


> [email protected] test C:\Users\m089269\WebstormProjects\loopback-angular-cli
> mocha


  .....

  0 passing (178ms)
  5 failing

  1) lb-ng prints help on no arguments:
     AssertionError: expected 'Command failed: \'"C:\\\\Users\\\\m089269\\\\WebstormProjects\\\\loopback-angular-cli\\\\bin\\
\\lb-ng"\' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n' to include 'Usage'
      at C:\Users\m089269\WebstormProjects\loopback-angular-cli\test\lb-ng.test.js:23:32
      at tryCatch1 (C:\Users\m089269\WebstormProjects\loopback-angular-cli\node_modules\bluebird\js\main\util.js:63:19)
      at Promise$_callHandler [as _callHandler] (C:\Users\m089269\WebstormProjects\loopback-angular-cli\node_modules\bluebird
\js\main\promise.js:695:13)
      at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (C:\Users\m089269\WebstormProjects\loopback-angular
-cli\node_modules\bluebird\js\main\promise.js:711:18)
      at Promise$_settlePromiseAt [as _settlePromiseAt] (C:\Users\m089269\WebstormProjects\loopback-angular-cli\node_modules\
bluebird\js\main\promise.js:868:14)
      at Promise$_settlePromises [as _settlePromises] (C:\Users\m089269\WebstormProjects\loopback-angular-cli\node_modules\bl
uebird\js\main\promise.js:1006:14)
      at Promise$_rejectPromises [as _rejectPromises] (C:\Users\m089269\WebstormProjects\loopback-angular-cli\node_modules\bl
uebird\js\main\promise.js:999:10)
      at Async$_consumeFunctionBuffer [as _consumeFunctionBuffer] (C:\Users\m089269\WebstormProjects\loopback-angular-cli\nod
e_modules\bluebird\js\main\async.js:74:12)
      at Async$consumeFunctionBuffer (C:\Users\m089269\WebstormProjects\loopback-angular-cli\node_modules\bluebird\js\main\as
ync.js:37:14)
      at process._tickCallback (node.js:415:13)

  2) lb-ng generates "lbServices" module with app.restApiRoot url:
     Error: Command failed: '"C:\\Users\\m089269\\WebstormProjects\\loopback-angular-cli\\bin\\lb-ng"' is not recognized as a
n internal or external command,
operable program or batch file.

      at ChildProcess.exithandler (child_process.js:637:15)
      at ChildProcess.EventEmitter.emit (events.js:98:17)
      at maybeClose (child_process.js:743:16)
      at Process.ChildProcess._handle.onexit (child_process.js:810:5)

  3) lb-ng uses the module name from command-line:
     Error: Command failed: '"C:\\Users\\m089269\\WebstormProjects\\loopback-angular-cli\\bin\\lb-ng"' is not recognized as a
n internal or external command,
operable program or batch file.

      at ChildProcess.exithandler (child_process.js:637:15)
      at ChildProcess.EventEmitter.emit (events.js:98:17)
      at maybeClose (child_process.js:743:16)
      at Process.ChildProcess._handle.onexit (child_process.js:810:5)

  4) lb-ng uses the url from command-line:
     Error: Command failed: '"C:\\Users\\m089269\\WebstormProjects\\loopback-angular-cli\\bin\\lb-ng"' is not recognized as a
n internal or external command,
operable program or batch file.

      at ChildProcess.exithandler (child_process.js:637:15)
      at ChildProcess.EventEmitter.emit (events.js:98:17)
      at maybeClose (child_process.js:743:16)
      at Process.ChildProcess._handle.onexit (child_process.js:810:5)

  5) lb-ng saves the script to a file:
     Error: Command failed: '"C:\\Users\\m089269\\WebstormProjects\\loopback-angular-cli\\bin\\lb-ng"' is not recognized as a
n internal or external command,
operable program or batch file.

      at ChildProcess.exithandler (child_process.js:637:15)
      at ChildProcess.EventEmitter.emit (events.js:98:17)
      at maybeClose (child_process.js:743:16)
      at Process.ChildProcess._handle.onexit (child_process.js:810:5)



npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

Error lb-ng

When I try to generate lb-services at the client with lb-ng command I'm getting this error:

bash-3.2$ lb-ng server/server.js client/www/lib/lb-services.js
Loading LoopBack app "/Users/carlosalvarez/Desktop/APIrest/Loopback/sample copy/server/server.js"

assert.js:85
throw new assert.AssertionError({
^
AssertionError: Invalid relation type: undefined
at /Users/carlosalvarez/Desktop/APIrest/Loopback/sample copy/node_modules/loopback-datasource-juggler/lib/dataso
urce.js:458:7
at Array.forEach (native)
at DataSource.defineRelations (/Users/carlosalvarez/Desktop/APIrest/Loopback/sample copy/node_modules/loopback-d
atasource-juggler/lib/datasource.js:456:28)
at DataSource.setupDataAccess (/Users/carlosalvarez/Desktop/APIrest/Loopback/sample copy/node_modules/loopback-d
atasource-juggler/lib/datasource.js:536:8)
at DataSource.attach (/Users/carlosalvarez/Desktop/APIrest/Loopback/sample copy/node_modules/loopback-datasource
-juggler/lib/datasource.js:753:8)
at Function.ModelClass.attachTo (/Users/carlosalvarez/Desktop/APIrest/Loopback/sample copy/node_modules/loopback
-datasource-juggler/lib/model-builder.js:339:16)
at Registry.configureModel (/Users/carlosalvarez/Desktop/APIrest/Loopback/sample copy/node_modules/loopback/lib/
registry.js:244:15)
at configureModel (/Users/carlosalvarez/Desktop/APIrest/Loopback/sample copy/node_modules/loopback/lib/applicati
on.js:466:16)
at EventEmitter.app.model (/Users/carlosalvarez/Desktop/APIrest/Loopback/sample copy/node_modules/loopback/lib/a
pplication.js:140:5)
at /Users/carlosalvarez/Desktop/APIrest/Loopback/sample copy/node_modules/loopback-boot/lib/executor.js:202:9
at Array.forEach (native)
at setupModels (/Users/carlosalvarez/Desktop/APIrest/Loopback/sample copy/node_modules/loopback-boot/lib/executo
r.js:198:23)
at execute (/Users/carlosalvarez/Desktop/APIrest/Loopback/sample copy/node_modules/loopback-boot/lib/executor.js
:39:3)
at bootLoopBackApp (/Users/carlosalvarez/Desktop/APIrest/Loopback/sample copy/node_modules/loopback-boot/index.j
s:154:3)
at Object. (/Users/carlosalvarez/Desktop/APIrest/Loopback/sample copy/server/server.js:16:1)
at Module._compile (module.js:570:32)

Any solution?
Thanks

[lb-ng] Dynamic api endpoint based on config file or env var

Hi,

I was wondering if it was possible to generate the lb-services file with a dynamic api endpoint.
Right now, you can either not specify one, in which case it will default to the host the app is served from.
Or you can specify one with -u https://some.api/endpoint.

I want to be able to say: (based on config file for example)

  • Locally use this endpoint: localhost:3333/api,
  • In Production use this endpoint: some.host/api

Without having to re-generate or modify the generated file each time.

Anybody have ideas ?
Thanks

npm test fails with DEBUG=*

To reproduce

DEBUG=* mocha or DEBUG=* npm test

Related code

expect(stdout).to.equal('');

Possible reason

stdout was purposely kept always empty, user can rely on it to get the lb-service
thats why all the console.log is done through console.error
see

g.error('Loading {{LoopBack}} app %j', appFile);

What happens

  test --EXECFILE["/Users/davidcheung/.nvm/versions/node/v6.3.0/bin/node" "/Users/davidcheung/node-web/loopback-sdk-angular-cli/bin/lb-ng.js" "-m" "a-module" "/Users/davidcheung/node-web/loopback-sdk-angular-cli/test/fixtures/app.js" "/Users/davidcheung/node-web/loopback-sdk-angular-cli/test/sandbox/lb-services.js"]-- +0ms
  test --STDOUT--
Fri, 12 Aug 2016 20:01:43 GMT strong-globalize *** loadMsgFromFile(new res tag): loading: en messages.json
Fri, 12 Aug 2016 20:01:43 GMT strong-globalize 1 03bb755ed8213986b1862be937b296bb : The name for generated Angular module.
Fri, 12 Aug 2016 20:01:43 GMT strong-globalize 2 25eecfaa310e55ace4ef6eba593ba32e : Generating {0} for the API endpoint {1}
Fri, 12 Aug 2016 20:01:43 GMT strong-globalize 3 3669f5dd8a727a4f4247d7ad86993e0c : 
The code generator does not support applications based on
LoopBack versions older than 1.6.0. Please upgrade your project
to a recent version of LoopBack and run this tool again.

Fri, 12 Aug 2016 20:01:43 GMT strong-globalize 4 af39e85bbd74a37c9a8beec4268564bd : Generate Angular $resource services for your LoopBack application.
Usage:
    $0 [options] server/app.js [client/js/lb-services.js]
Fri, 12 Aug 2016 20:01:43 GMT strong-globalize 5 dbef1e1c2cc9f52ae9aacca33e9d92c2 : Saving the generated services source to {0}
Fri, 12 Aug 2016 20:01:43 GMT strong-globalize 6 dff77762368d4e45c34a01e661ad2c06 : Loading LoopBack app {0}
Fri, 12 Aug 2016 20:01:43 GMT strong-globalize 7 efc6bce92bcb061e3e354a888c7bd76a : Dumping to stdout
Fri, 12 Aug 2016 20:01:43 GMT strong-globalize 8 fc1c9755ca71e88d7aaa4be225d07bc8 : URL of the REST API end-point
Fri, 12 Aug 2016 20:01:44 GMT hahahaha OMG
Fri, 12 Aug 2016 20:01:44 GMT strong-globalize packMessage: Generate {{Angular $resource}} services for your {{LoopBack}} application.
Usage:
    $0 {{[options] server/app.js [client/js/lb-services.js]}} {
  "0": "Generate {{Angular $resource}} services for your {{LoopBack}} application.\nUsage:\n    $0 {{[options] server/app.js [client/js/lb-services.js]}}"
} undefined
Fri, 12 Aug 2016 20:01:44 GMT strong-globalize ~~~ lang = en af39e85bbd74a37c9a8beec4268564bd undefined /Users/davidcheung/node-web/loopback-sdk-angular-cli/node_modules/strong-globalize/lib/globalize.js
Fri, 12 Aug 2016 20:01:44 GMT strong-globalize packMessage: The name for generated {{Angular}} module. {
  "0": "The name for generated {{Angular}} module."
} undefined
Fri, 12 Aug 2016 20:01:44 GMT strong-globalize ~~~ lang = en 03bb755ed8213986b1862be937b296bb undefined /Users/davidcheung/node-web/loopback-sdk-angular-cli/node_modules/strong-globalize/lib/globalize.js
Fri, 12 Aug 2016 20:01:44 GMT strong-globalize packMessage: URL of the REST API end-point {
  "0": "URL of the REST API end-point"
} undefined
Fri, 12 Aug 2016 20:01:44 GMT strong-globalize ~~~ lang = en fc1c9755ca71e88d7aaa4be225d07bc8 undefined /Users/davidcheung/node-web/loopback-sdk-angular-cli/node_modules/strong-globalize/lib/globalize.js
Fri, 12 Aug 2016 20:01:44 GMT strong-globalize packMessage: Loading {{LoopBack}} app %j {
  "0": "Loading {{LoopBack}} app %j",
  "1": "/Users/davidcheung/node-web/loopback-sdk-angular-cli/test/fixtures/app.js"
} [ '"/Users/davidcheung/node-web/loopback-sdk-angular-cli/test/fixtures/app.js"' ]
Fri, 12 Aug 2016 20:01:44 GMT strong-globalize ~~~ lang = en dff77762368d4e45c34a01e661ad2c06 ["\"/Users/davidcheung/node-web/loopback-sdk-angular-cli/test/fixtures/app.js\""] /Users/davidcheung/node-web/loopback-sdk-angular-cli/node_modules/strong-globalize/lib/globalize.js
Fri, 12 Aug 2016 20:01:44 GMT strong-globalize packMessage: Generating %j for the API endpoint %j {
  "0": "Generating %j for the API endpoint %j",
  "1": "a-module",
  "2": "/rest-api-root"
} [ '"a-module"', '"/rest-api-root"' ]
Fri, 12 Aug 2016 20:01:44 GMT strong-globalize ~~~ lang = en 25eecfaa310e55ace4ef6eba593ba32e ["\"a-module\"","\"/rest-api-root\""] /Users/davidcheung/node-web/loopback-sdk-angular-cli/node_modules/strong-globalize/lib/globalize.js
Fri, 12 Aug 2016 20:01:44 GMT strong-globalize packMessage: Saving the generated services source to %j {
  "0": "Saving the generated services source to %j",
  "1": "/Users/davidcheung/node-web/loopback-sdk-angular-cli/test/sandbox/lb-services.js"
} [ '"/Users/davidcheung/node-web/loopback-sdk-angular-cli/test/sandbox/lb-services.js"' ]
Fri, 12 Aug 2016 20:01:44 GMT strong-globalize ~~~ lang = en dbef1e1c2cc9f52ae9aacca33e9d92c2 ["\"/Users/davidcheung/node-web/loopback-sdk-angular-cli/test/sandbox/lb-services.js\""] /Users/davidcheung/node-web/loopback-sdk-angular-cli/node_modules/strong-globalize/lib/globalize.js

--STDERR--
Loading LoopBack app "/Users/davidcheung/node-web/loopback-sdk-angular-cli/test/fixtures/app.js"
Fri, 12 Aug 2016 20:01:44 GMT express:application set "x-powered-by" to true
Fri, 12 Aug 2016 20:01:44 GMT express:application set "etag" to 'weak'
Fri, 12 Aug 2016 20:01:44 GMT express:application set "etag fn" to [Function: wetag]
Fri, 12 Aug 2016 20:01:44 GMT express:application set "env" to 'development'
Fri, 12 Aug 2016 20:01:44 GMT express:application set "query parser" to 'extended'
Fri, 12 Aug 2016 20:01:44 GMT express:application set "query parser fn" to [Function: parseExtendedQueryString]
Fri, 12 Aug 2016 20:01:44 GMT express:application set "subdomain offset" to 2
Fri, 12 Aug 2016 20:01:44 GMT express:application set "trust proxy" to false
Fri, 12 Aug 2016 20:01:44 GMT express:application set "trust proxy fn" to [Function: trustNone]
Fri, 12 Aug 2016 20:01:44 GMT express:application booting in development mode
Fri, 12 Aug 2016 20:01:44 GMT express:application set "view" to [Function: View]
Fri, 12 Aug 2016 20:01:44 GMT express:application set "views" to '/Users/davidcheung/node-web/loopback-sdk-angular-cli/views'
Fri, 12 Aug 2016 20:01:44 GMT express:application set "jsonp callback name" to 'callback'
Fri, 12 Aug 2016 20:01:44 GMT loopback:datasource Settings: {"debug":true}
Fri, 12 Aug 2016 20:01:44 GMT loopback:registry Attached model `User` to dataSource `Memory`
Fri, 12 Aug 2016 20:01:44 GMT express:application set "restApiRoot" to '/rest-api-root'
Generating "a-module" for the API endpoint "/rest-api-root"
Fri, 12 Aug 2016 20:01:44 GMT express:router use / <anonymous>
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter remoting options: {}
Fri, 12 Aug 2016 20:01:44 GMT express:router use / <anonymous>
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT express:router use / urlencodedParser
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT express:router use / jsonParser
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter registering REST handler for class "User"
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter     method User.create
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter     method User.upsert
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter     method User.exists
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter     method User.findById
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter     method User.find
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter     method User.findOne
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter     method User.updateAll
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter     method User.deleteById
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter     method User.count
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter     method User.prototype.updateAttributes
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter     method User.createChangeStream
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter         put /:id restPrototypeMethodHandler
Fri, 12 Aug 2016 20:01:44 GMT express:router:route new /:id
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /:id
Fri, 12 Aug 2016 20:01:44 GMT express:router:route put /:id
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter         put / restStaticMethodHandler
Fri, 12 Aug 2016 20:01:44 GMT express:router:route new /
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT express:router:route put /
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter         post /change-stream restStaticMethodHandler
Fri, 12 Aug 2016 20:01:44 GMT express:router:route new /change-stream
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /change-stream
Fri, 12 Aug 2016 20:01:44 GMT express:router:route post /change-stream
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter         post /update restStaticMethodHandler
Fri, 12 Aug 2016 20:01:44 GMT express:router:route new /update
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /update
Fri, 12 Aug 2016 20:01:44 GMT express:router:route post /update
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter         post / restStaticMethodHandler
Fri, 12 Aug 2016 20:01:44 GMT express:router:route new /
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT express:router:route post /
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter         head /:id restStaticMethodHandler
Fri, 12 Aug 2016 20:01:44 GMT express:router:route new /:id
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /:id
Fri, 12 Aug 2016 20:01:44 GMT express:router:route head /:id
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter         get /change-stream restStaticMethodHandler
Fri, 12 Aug 2016 20:01:44 GMT express:router:route new /change-stream
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /change-stream
Fri, 12 Aug 2016 20:01:44 GMT express:router:route get /change-stream
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter         get /count restStaticMethodHandler
Fri, 12 Aug 2016 20:01:44 GMT express:router:route new /count
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /count
Fri, 12 Aug 2016 20:01:44 GMT express:router:route get /count
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter         get /findOne restStaticMethodHandler
Fri, 12 Aug 2016 20:01:44 GMT express:router:route new /findOne
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /findOne
Fri, 12 Aug 2016 20:01:44 GMT express:router:route get /findOne
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter         get /:id/exists restStaticMethodHandler
Fri, 12 Aug 2016 20:01:44 GMT express:router:route new /:id/exists
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /:id/exists
Fri, 12 Aug 2016 20:01:44 GMT express:router:route get /:id/exists
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter         get /:id restStaticMethodHandler
Fri, 12 Aug 2016 20:01:44 GMT express:router:route new /:id
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /:id
Fri, 12 Aug 2016 20:01:44 GMT express:router:route get /:id
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter         get / restStaticMethodHandler
Fri, 12 Aug 2016 20:01:44 GMT express:router:route new /
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT express:router:route get /
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter         del /:id restStaticMethodHandler
Fri, 12 Aug 2016 20:01:44 GMT express:router:route new /:id
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /:id
Fri, 12 Aug 2016 20:01:44 GMT express:router:route delete /:id
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT express:router use / restRemoteMethodNotFound
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT strong-remoting:rest-adapter     at /Users
Fri, 12 Aug 2016 20:01:44 GMT express:router use /Users router
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /Users
Fri, 12 Aug 2016 20:01:44 GMT express:router use / restUrlNotFound
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Fri, 12 Aug 2016 20:01:44 GMT express:router use / restErrorHandler
Fri, 12 Aug 2016 20:01:44 GMT express:router:layer new /
Saving the generated services source to "/Users/davidcheung/node-web/loopback-sdk-angular-cli/test/sandbox/lb-services.js"

Incompatibility with generators

Hello!

In my model I used a remoteMethod how use generator.

When I use lb-ng server/server.js ./lb-service.js I got this exception:

Loading LoopBack app "/pathToProject/server/server.js"
/pathToProject/common/service/moltin/product.js:12
    generatorHelper.run(function*() {
                                ^
SyntaxError: Unexpected token *
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/pathToProject/common/models/product.js:3:22)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at /pathToProject/node_modules/loopback-boot/lib/executor.js:194:20
    at Array.forEach (native)

Is there a way to execute this lb-ng utils with --harmony_generators ?

feature request: auto generate sample code

I am trying to understand fully how the calls are made. I was wondering if it was possible to auto generate sample code for each call. Specially with some complex queries and geolocation integration.

lb-ng errors on remote methods with array-based argument definitions

The lb-ng command fails if any exposed models contain remoteMethod definitions where at least one argument definition is an array. This seems to counter the Loopback docs which state that arrays are supported for long strings: https://docs.strongloop.com/display/public/LB/Remote+methods#Remotemethods-Argumentdescriptions

Here is the stack trace:

throw err;
  ^

TypeError: ejs:435
    433| -%>
    434| 
 >> 435| <%
    436|   if (action.internal) {
    437| -%>
    438|         // INTERNAL. <%- action.internal %>

(arg.description || "").replace is not a function
    at eval (eval at <anonymous> (/usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/loopback-sdk-angular/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:102:25)
    at Array.forEach (native)
    at ngdocForMethod (eval at <anonymous> (/usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/loopback-sdk-angular/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:101:314)
    at eval (eval at <anonymous> (/usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/loopback-sdk-angular/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:41:92)
    at Array.forEach (native)
    at eval (eval at <anonymous> (/usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/loopback-sdk-angular/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:40:87)
    at eval (eval at <anonymous> (/usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/loopback-sdk-angular/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:111:50)
    at /usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/loopback-sdk-angular/node_modules/ejs/lib/ejs.js:255:15
    at Object.exports.render (/usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/loopback-sdk-angular/node_modules/ejs/lib/ejs.js:293:13)
    at Object.generateServices [as services] (/usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/loopback-sdk-angular/lib/services.js:38:14)

Changing the offending arguments from array to string fixes the issue.

Extra comma issue

Hello,

I'm using the latest version of the CLI and as well as the storage containers model. linting reported the following extra comma error:

see: <<<<<<<<<<<<

 /**
         * @ngdoc method
         * @name lbServices.Container#download
         * @methodOf lbServices.Container
         *
         * @description
         *
         * <em>
         * (The remote method definition does not provide any description.)
         * </em>
         *
         * @param {Object=} parameters Request parameters.
         *
         *  - `container` – `{string=}` - 
         *
         *  - `file` – `{string=}` - 
         *
         *  - `res` – `{object=}` - 
         *
         * @param {function(Object,Object)=} successCb
         *   Success callback with two arguments: `value`, `responseHeaders`.
         *
         * @param {function(Object)=} errorCb Error callback with one argument:
         *   `httpResponse`.
         *
         * @returns {Object} An empty reference that will be
         *   populated with the actual data once the response is returned
         *   from the server.
         *
         * This method returns no data.
         */
        "download": {
          url: urlBase + "/containers/:container/download/:file",
          method: "GET"
        }, // <<<<<<<<<<<<  trailing comma
      }
    );

Replace docular with dgeni and/or strong-docs

Docular was broken and abandoned for a while. The new maintainers did not make the situation any better.

We should drop docular and use dgeni from the AngularJS team or opensource our private strong-docs tool.

jslint error for getCurrent User:

Hi,

I encountered the following jslint error:

Expected '{' and instead saw 'id'.
              if (id == null) id = '__anonymous__';


"getCurrent": {
           url: urlBase + "/users" + "/:id",
           method: "GET",
           params: {
             id: function() {
              var id = LoopBackAuth.currentUserId;
              if (id == null) id = '__anonymous__';
              return id;
            },
          },
          interceptor: {
            response: function(response) {
              LoopBackAuth.currentUserData = response.data;
              return response.resource;
            }
          },
          __isGetCurrentUser__ : true
        }

I believe this can be corrected by:

if (id == null) {
    id = '__anonymous__';
}

thanks.

Spike: Add LB real time capabilities to Angular models

As a LB front end developer using Angular, I would want to be able to use the Angular SDK CLI tool to offer the scaffolding capability to create Angular models that are sync'ed back to LoopBack using loopback-pubsub with loopback-replication so that I have models and views updated in realtime for both front end and backend.

lb-ng not generating the services.

I am geting this error when I try to generate the lb-services with the help of lb-ng tool. This is strange because I seem to run the right command i.e,

   lb-ng server/server.js client/scripts/services/lb-services.js

The error I am getting in the terminal is :-

TypeError: Cannot read property 'name' of undefined
   at DataSource.columnMetadata (/Users/sayan/dev/lb-app/node_modules/loopback-datasource-juggler/lib/datasource.js:1741:74)
   at DataSource.defineForeignKey (/Users/sayan/dev/lb-app/node_modules/loopback-datasource-juggler/lib/datasource.js:1818:26)
   at Function.hasMany (/Users/sayan/dev/lb-app/node_modules/loopback-datasource-juggler/lib/relation-definition.js:632:24)
   at Function.hasMany (/Users/sayan/dev/lb-app/node_modules/loopback-datasource-juggler/lib/relations.js:68:29)
   at EventEmitter.<anonymous> (/Users/sayan/dev/lb-app/node_modules/loopback-datasource-juggler/lib/datasource.js:420:37)
   at EventEmitter.g (events.js:180:16)
   at EventEmitter.emit (events.js:95:17)
   at DataSource.setupDataAccess (/Users/sayan/dev/lb-app/node_modules/loopback-datasource-juggler/lib/datasource.js:526:14)
   at DataSource.attach (/Users/sayan/dev/lb-app/node_modules/loopback-datasource-juggler/lib/datasource.js:738:8)
   at Function.ModelClass.attachTo (/Users/sayan/dev/lb-app/node_modules/loopback-datasource-juggler/lib/model-builder.js:331:16)
   at Registry.configureModel (/Users/sayan/dev/lb-app/node_modules/loopback/lib/registry.js:238:15)
   at configureModel (/Users/sayan/dev/lb-app/node_modules/loopback/lib/application.js:441:16)
   at EventEmitter.app.model (/Users/sayan/dev/lb-app/node_modules/loopback/lib/application.js:133:5)
   at /Users/sayan/dev/lb-app/node_modules/loopback-boot/lib/executor.js:186:9
   at Array.forEach (native)
   at setupModels (/Users/sayan/dev/lb-app/node_modules/loopback-boot/lib/executor.js:182:23)
   at execute (/Users/sayan/dev/lb-app/node_modules/loopback-boot/lib/executor.js:33:3)
   at bootLoopBackApp (/Users/sayan/dev/lb-app/node_modules/loopback-boot/index.js:140:3)
   at Object.<anonymous> (/Users/sayan/dev/lb-app/server/server.js:22:1)
   at Module._compile (module.js:456:26)
   at Object.Module._extensions..js (module.js:474:10)
   at Module.load (module.js:356:32)

Any help on this?

lb-ng fails in windows xp

In the tutorial LoopBack/Getting started part II http://docs.strongloop.com/display/public/LB/Create+AngularJS+client, When I try to execute command: lb-ng server/server.js client/js/services/lb-services.js.
It failed:
C:\learn\loopbackLearn>lb-ng server/server.js client/js/services/lb-services.js
Loading LoopBack app "C:\learn\loopbackLearn\server\server.js"
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }

js-bson: Failed to load c++ bson extension, using pure JS version
module.js:338
throw err;
^
Error: Cannot find module 'async'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (C:\learn\loopbackLearn\server\boot\create-sample-mode
ls.js:1:75)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)

lb-ng-doc doesn't work on windows

Output:

D:\loopback-workshop\whiskey>lb-ng-doc client/scripts/lb-services.js
Using lb-ng file "D:\\loopback-workshop\\whiskey\\client\\scripts\\lb-services.j
s"

-------- verifying plugins --------
-------- generating Docs --------
Extracting loopback Docs For Section "lbServices"...
-------- generating partials directories for groups --------
-------- generating partials directories for sections --------
-------- merging child docs with parent docs --------
-------- generating partials --------
Generating support files
Generating webapp partials
Generating config partials
Generation complete
-------- generating index.html page --------
-------- gathering all doc_api, plugin, and configured css and js --------
-------- generating report --------
DONE! Generated 5 pages in 484 ms. Partials per second : 10

Browse the documentation at http://localhost:3030/
 { [Error: spawn ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn' }

lb-ng-doc hangs at 'verifying plugins'

It just sits there at verifying plugins... doing nothing. Not sure why it won't run anymore. Anyway to debug this? Hangs whether I use the cli to generate the file or the node module.

OSX 10.9.3
Node 0.10.30
Strong-Cli 2.6.2
loopback-sdk-angular-cli 1.1.4

Loopback API change breaks delete method

Previously, Loopback delete API returned 204 No Content for all requests, now (in version 2.25.0 at least) it returns 200 OK and an empty array. This causes Angular to throw an error:
"Error in resource configuration for action deleteById. Expected response to contain an object but got an array"

See: strongloop/loopback#1322

lb-ng-doc client/js/lb-services.js can't generate in loopback-example-extendedAPI

lb-ng-doc client/js/lb-services.js
Using lb-ng file "/home/tengen/work/node/loopback-example-extendedAPI/client/js/lb-services.js"

-------- verifying plugins --------
-------- generating Docs --------
Extracting loopback Docs For Section "lbServices"...
ERROR:  creating script doc: /home/tengen/work/node/loopback-example-extendedAPI/client/js/lb-services.js : loopback : lbServices [Error: Not a valid 'param' format: {string} url]
-------- generating partials directories for groups --------
-------- generating partials directories for sections --------
-------- merging child docs with parent docs --------
-------- generating partials --------
WARNING:  doc_api html method failure for 'provider' in doc_api: ngdoc [Error: Don't know how to format docType: 'provider']
Generating support files
Generating webapp partials
Generating config partials
Generation complete
-------- generating index.html page --------
-------- gathering all doc_api, plugin, and configured css and js --------
-------- generating report --------
DONE! Generated 5 pages in 592 ms. Partials per second : 8

Browse the documentation at http://localhost:3030/
npm ll docular
[email protected]
│ /home/tengen/local/lib/node_modules/strongloop
│ StrongLoop Command Line Tools
│ git://github.com/strongloop/strongloop.git
│ http://www.strongloop.com
└─┬ [email protected]
  │ CLI tools for auto-generating Angular $resource services for LoopBack
  │ git://github.com/strongloop/loopback-sdk-angular-cli.git
  │ https://github.com/strongloop/loopback-sdk-angular-cli
  └── [email protected] 
      Extensible Documentation Generation Based on AngularJS's Documentation Generation
      https://github.com/Vertafore/docular.git
      http://grunt-docular.com

Is [email protected] old version ?

If change to [email protected], that

lb-ng-doc client/js/lb-services.js
Using lb-ng file "/home/tengen/work/node/loopback-example-extendedAPI/client/js/lb-services.js"
Loading individual files for gid: Base
Loading individual files for gid: loopback
Loading individual files for gid: lbServices
Parsing files for gid:  Base
Parsing files for gid:  loopback
Parsing files for gid:  lbServices
Backfilling file data for gid:  Base
Backfilling file data for gid:  loopback
Backfilling file data for gid:  lbServices
Creating docs from for gid:  Base
Creating docs from for gid:  loopback
Creating docs from for gid:  lbServices

But no local http browser...

stderr maxBuffer exceeded

Problem

CI failure due to maxBuffer exceeded

Reason

when running DEBUG=* (which jenkins do) in a child_process
the child gets overwhelmed by globalization :(

Possible solution

  1. Exclude strong-globalize's debug messages from Jenkins like we do for mocha
    something like DEBUG=*,-mocha,-strong-globalize
  2. Increase maxBuffer size (for lb-ng tests), since Users are unlikely to generate their lb-ng with DEBUG=* it should solve this problem too

See http://ci.strongloop.com/job/loopback-sdk-angular-cli/label=ubuntu-4/2385/console

1) generates "lbServices" module with app.restApiRoot url
Thu, 11 Aug 2016 21:20:16 GMT test --EXECFILE["/usr/local/bin/node" "/mnt/jenkins/workspace/loopback-sdk-angular-cli/e13f9a50/bin/lb-ng.js" "-m" "a-module-name" "/mnt/jenkins/workspace/loopback-sdk-angular-cli/e13f9a50/test/fixtures/app.js"]--
Thu, 11 Aug 2016 21:20:18 GMT test --FAILED--
Error: stderr maxBuffer exceeded
    at Socket.<anonymous> (child_process.js:285:14)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at Pipe.onread (net.js:536:20)
---------------------------------------------
    at Object.exports.execFile (child_process.js:296:9)
    at exports.exec (child_process.js:111:18)
    at promisified (eval at makeNodePromisifiedEval (/mnt/jenkins/workspace/loopback-sdk-angular-cli/e13f9a50/node_modules/bluebird/js/main/promisify.js:198:12), <anonymous>:3:246)
    at runLbNg (/mnt/jenkins/workspace/loopback-sdk-angular-cli/e13f9a50/test/lb-ng.test.js:91:12)
    at Context.<anonymous> (/mnt/jenkins/workspace/loopback-sdk-angular-cli/e13f9a50/test/lb-ng.test.js:44:12)
    at callFn (/mnt/jenkins/workspace/loopback-sdk-angular-cli/e13f9a50/

hasMany through relations not created in lb-services

I have 3 model user, request and donation. Following the the relations between them.

user

{
  "name": "user",
  "plural": "user",
  "base": "User",
  "idInjection": true,
  "options": {
    "validateUpsert": true
  },
"relations": {
    "requests": {
      "type": "hasMany",
      "model": "request",
      "foreignKey": "userId"
    },
    "donations": {
      "type": "hasMany",
      "model": "request",
      "foreignKey": "userId",
      "through": "donation"
    }
  },
...
...

request

{
  "name": "request",
  "base": "PersistedModel",
  "idInjection": true,
  "options": {
    "validateUpsert": true
  },
"relations": {
    "user": {
      "type": "belongsTo",
      "model": "user",
      "foreignKey": "userId"
    },
    "donators": {
      "type": "hasMany",
      "model": "user",
      "foreignKey": "requestId",
      "through": "donation"
    }
  },
...
...

donation

{
  "name": "donation",
  "base": "PersistedModel",
  "idInjection": true,
  "options": {
    "validateUpsert": true
  },
  "relations": {
    "donator": {
      "type": "belongsTo",
      "model": "user",
      "foreignKey": "userId"
    },
    "request": {
      "type": "belongsTo",
      "model": "request",
      "foreignKey": "requestId"
    }
  },
...
...

I created the lb-services using the lb-ng cli too. The service is created with User.donoations.create() service but not with Request.donators.create(). No services related to Request.donators are created.

lb-ng never exits v2.2.0

Hi,

It seems that version 2.2.0 reintroduces a bug which was fixed earlier. This bug prevents the lb-ng script from exiting. Instead it will start the server after generating the lbServices file.

I've investigated the issue myself and I found that replacing the code on line 70-75 (https://github.com/strongloop/loopback-sdk-angular-cli/blob/master/bin/lb-ng.js#L70) with the code of v2.0.1, lines 55-57 (https://github.com/strongloop/loopback-sdk-angular-cli/blob/v2.0.1/bin/lb-ng#L55) does restore the expected behaviour.

Angular SDK critical issue

SDK making invalid requests. 2 in particular:

when searching making a findOne request, the resource module throws an error expecting response as array.

the second error goes when trying to make a find request. The sdk makes the request to

GET /api/activities/findOne?where=%7B%22id%22:%225382552935ee740000609057%22%7D

the proper request is stated in the image below.
moreproof

Support for Loopback with ES6

When I try to use lg-nb command with a loopback es6 server this crashes. I began using loopback with es6 and Babel, it's important generate services for my Angular App from my loopback es6 server.

Thanks!

lb-ng Hanging on Windows

Everytime I run the lb-ng command it hangs on "Saving the generated services source". Inevitably, I will get tired of waiting and stop the process (manually). However, when actually check the file that was generated, it contains all of the correct models and endpoints I defined in my API.

I am not 100% certain that this is a reproducible error, however I would love to know if anyone else is experiencing this same issue.

Node - 6.9.1
Operating System - Windows 10

error in lb-ng command

Hi, I am trying to generate lb-ng services file from command line, it is giving a type error. not sure why this error is coming, previously i was able to generate file from api, I may be doing something small mistake. please gude me. is it complaining about missing node modules or some issue in my server code? or is it a bug in the SDK?

vagrant@vagrant-ubuntu-trusty-32:/api$ lb-ng server/server.js client/js/services/lb-services.js -m lbServices -u http://192.168.57.50:3000/api
Loading LoopBack app "/api/server/server.js"
Generating "lbServices" for the API endpoint "http://192.168.57.50:3000/api"
/usr/lib/node_modules/strongloop/node_modules/loopback-sdk-angular-cli/node_modu
les/loopback-sdk-angular/lib/services.js:47
  app.handler('rest').adapter.getClasses().forEach(function(c) {
      ^
TypeError: undefined is not a function
    at describeModels (/usr/lib/node_modules/strongloop/node_modules/loopback-sd
k-angular-cli/node_modules/loopback-sdk-angular/lib/services.js:47:7)
    at Object.generateServices [as services] (/usr/lib/node_modules/strongloop/n
ode_modules/loopback-sdk-angular-cli/node_modules/loopback-sdk-angular/lib/servi
ces.js:31:16)
    at Object.<anonymous> (/usr/lib/node_modules/strongloop/node_modules/loopbac
k-sdk-angular-cli/bin/lb-ng:31:24)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.