我有一个问题。尝试在我的应用程序的根文件夹中运行lb-ng服务生成器时... 例如lb-ng server / server.js client / js / app / services / lb-ng-services.js
我从终端收到以下错误:
[ERROR] TypeError: app.get is not a function
at runGenerator (C:\Users\Wandumuzi Mathunjwa\AppData\Roaming\npm\node_modules\strongloop\node_modules\lo
opback-sdk angular-cli\bin\lb-ng.js:43:35)
at Object.<anonymous> (C:\Users\Wandumuzi Mathunjwa\AppData\Roaming\npm\node_modules\strongloop\node_modules\loopback-sdk-angular-cli\bin\lb-ng.js:38:3)
at Module._compile (module.js:649:30)
at Object.Module._extensions..js (module.js:660:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)
at Function.Module.runMain (module.js:690:10)
at startup (bootstrap_node.js:194:16)
at bootstrap_node.js:666:3
这是在创建新模型后完成的,因此需要将其公开给回送API。该模型本身已迁移到数据源(postGres),现在只需要将其注册到lb-ng-services.js文件中即可。