digitalmachinist / loopback-angular-ui-router Goto Github PK
View Code? Open in Web Editor NEWA starter pack for creating websites hosting a LoopBack REST API presented using an AngularJS and Bootstrap (CSS) frontend.
License: MIT License
A starter pack for creating websites hosting a LoopBack REST API presented using an AngularJS and Bootstrap (CSS) frontend.
License: MIT License
I'm trying to use this project and am getting errors during grunt testing regarding gitWritingApp despite the commit logs saying that module has been removed:
Errors:
INFO [karma]: Karma v0.12.37 server started at http://localhost:8080/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 45.0.2454 (Windows 7 0.0.0)]: Connected on socket aFZm5L8SP6nAcwUyItMJ with id 18391702
Chrome 45.0.2454 (Windows 7 0.0.0) Module: gitWritingApp Controller: MainCtrl should attach a list of awesomeThings to the scope FAILED
Error: [$injector:modulerr] Failed to instantiate module gitWritingApp due to:
Error: [$injector:nomod] Module 'gitWritingApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.4.6/$injector/nomod?p0=gitWritingApp
at E:/Dvlp/AngularJS/loopback-angular-ui-router/loopback-angular-ui-router/app/bower_components/angular/angular.js:68:12
at E:/Dvlp/AngularJS/loopback-angular-ui-router/loopback-angular-ui-router/app/bower_components/angular/angular.js:1986:17
at ensure (E:/Dvlp/AngularJS/loopback-angular-ui-router/loopback-angular-ui-router/app/bower_components/angular/angular.js:1910:38)
at module (E:/Dvlp/AngularJS/loopback-angular-ui-router/loopback-angular-ui-router/app/bower_components/angular/angular.js:1984:14)
at E:/Dvlp/AngularJS/loopback-angular-ui-router/loopback-angular-ui-router/app/bower_components/angular/angular.js:4388:22
at forEach (E:/Dvlp/AngularJS/loopback-angular-ui-router/loopback-angular-ui-router/app/bower_components/angular/angular.js:336:20)
at loadModules (E:/Dvlp/AngularJS/loopback-angular-ui-router/loopback-angular-ui-router/app/bower_components/angular/angular.js:4372:5)
at Object.createInjector as injector
at Object.workFn (E:/Dvlp/AngularJS/loopback-angular-ui-router/loopback-angular-ui-router/app/bower_components/angular-mocks/angular-mocks.js:2427:52)
http://errors.angularjs.org/1.4.6/$injector/modulerr?p0=gitWritingApp&p1=Error%3A%20%5B%24injector%3Anomod%5D%20Module%20'gitWritingApp'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.4.6%2F%24injector%2Fnomod%3Fp0%3DgitWritingApp%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3Fe9c46e66ca534bf6008860176d93bae434687fb7%3A68%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3Fe9c46e66ca534bf6008860176d93bae434687fb7%3A1986%3A17%0A%20%20%20%20at%20ensure%20(http%3A%2F%2Flocalhost%3A8080%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3Fe9c46e66ca534bf6008860176d93bae434687fb7%3A1910%3A38)%0A%20%20%20%20at%20module%20(http%3A%2F%2Flocalhost%3A8080%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3Fe9c46e66ca534bf6008860176d93bae434687fb7%3A1984%3A14)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3Fe9c46e66ca534bf6008860176d93bae434687fb7%3A4388%3A22%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A8080%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3Fe9c46e66ca534bf6008860176d93bae434687fb7%3A336%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A8080%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3Fe9c46e66ca534bf6008860176d93bae434687fb7%3A4372%3A5)%0A%20%20%20%20at%20Object.createInjector%20%5Bas%20injector%5D%20(http%3A%2F%2Flocalhost%3A8080%2Fbase%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3Fe9c46e66ca534bf6008860176d93bae434687fb7%3A4297%3A11)%0A%20%20%20%20at%20Object.workFn%20(http%3A%2F%2Flocalhost%3A8080%2Fbase%2Fapp%2Fbower_components%2Fangular-mocks%2Fangular-mocks.js%3Fa6f60920a9e460d21052862d777b6f079abcf5a0%3A2427%3A52)%0A%20%20%20%20at%20attemptSync%20(http%3A%2F%2Flocalhost%3A8080%2Fbase%2Fnode_modules%2Fjasmine-core%2Flib%2Fjasmine-core%2Fjasmine.js%3F578a1e5ff14db21b04e2d6db7fd0eda37042440c%3A1789%3A24)
at E:/Dvlp/AngularJS/loopback-angular-ui-router/loopback-angular-ui-router/app/bower_components/angular/angular.js:68:12
at forEach (E:/Dvlp/AngularJS/loopback-angular-ui-router/loopback-angular-ui-router/app/bower_components/angular/angular.js:336:20)
at loadModules (E:/Dvlp/AngularJS/loopback-angular-ui-router/loopback-angular-ui-router/app/bower_components/angular/angular.js:4372:5)
at Object.createInjector as injector
at Object.workFn (E:/Dvlp/AngularJS/loopback-angular-ui-router/loopback-angular-ui-router/app/bower_components/angular-mocks/angular-mocks.js:2427:52)
at E:/Dvlp/AngularJS/loopback-angular-ui-router/loopback-angular-ui-router/app/bower_components/angular/angular.js:4411:15
TypeError: Cannot read property 'awesomeThings' of undefined
at Object. (E:/Dvlp/AngularJS/loopback-angular-ui-router/loopback-angular-ui-router/test/spec/controllers/main.js:20:20)
Chrome 45.0.2454 (Windows 7 0.0.0): Executed 1 of 1 (1 FAILED) ERROR (0.034 secs / 0.029 secs)
Warning: Task "karma:unit" failed. Use --force to continue.
Aborted due to warnings.
I started to customized the scaffold project adding loopback-component-passport and a basic user authentication system (I've already done directly in loopback and it works).
I added a new model in /common/models/user-credential.json like so
{
"name": "userCredential",
"plural": "userCredentials",
"base": "UserCredential",
"properties": {},
"validations": [],
"relations": {
"user": {
"type": "belongsTo",
"model": "AppUser",
"foreignKey": "userId"
}
},
"acls": [],
"methods": {}
}
and updated model-config.json like so
{
"_meta": {
"sources": [
"loopback/common/models",
"loopback/server/models",
"../common/models",
"./models",
"./node_modules/loopback-component-passport/lib/models"
],
"mixins": [
"loopback/common/mixins",
"loopback/server/mixins",
"../common/mixins",
"./mixins"
]
},
"userCredential": {
"dataSource": "db",
"public": false
},....
Even if the new "sources" field for passport is correctly defined when launching grunt or lb-ng I get an error that userCredential cannot be found.....
Any hint?
Could someone help me activating the Loopback Api Explorer on the scaffold project?
I think it's a routing problem. I've added npm loopback-component-explorer to package.json
and modified app.start in server.js like this
app.start = function () {
// start the web server
return app.listen( function () {
app.emit( 'started' );
var baseUrl = app.get('url').replace(//$/, '');
console.log('Web server listening at: %s', baseUrl);
if (app.get('loopback-component-explorer')) {
var explorerPath = app.get('loopback-component-explorer').mountPath;
console.log('Browse your REST API at %s%s', baseUrl, explorerPath);
}
} );
but still it's impossible to access to the explorer.
Please help
Thanks for the great project! I love loopback, and have been banging my head trying to get it working with an angular generator.
In the docs you have:
grunt serve
But the task is called server. grunt serve gets me no joy, but
grunt server
Works as expected.
Thanks again!
I'm getting the message:
Warning: Task "serve" not found.
when I run grunt serve
. The app works fine with node .
command. Maybe the gruntfile is not being generated properly?
Anyway, this is an awesome generator. Congrats!
When I added my first model to be accessed from the app, I was getting errors when trying to use that model in a controller in the client. Adding 'LoopBack' as a module requirement fixed it. Maybe this is totally obvious to people, but as someone relatively new to Angular, Node, and LoopBack, it threw me for a couple hours. Maybe it would be appropriate to automatically include it? Like so?
angular
.module( 'yourApp', [
'ngResource',
'ui.router',
'LoopBack'
] )
.config...
Any chance you could include flag for boostrap 4 vs 3?
I was about to build this same generator but would prefer latest. Such as boostrap 4 and at some point Angular 2 after beta.
Also I will do passport itntegration. If you would like I can share.
Cheers
Art
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.