feathersjs-ecosystem / feathers-chat-angular Goto Github PK
View Code? Open in Web Editor NEWAn angular implementation of a feathers-chat client
An angular implementation of a feathers-chat client
hello, i created ionic version using this sample, login and registration works but using feather service return "token NotAuthenticated: No auth token". any idea why i get this error even after authentication
ionic component
messages$: Observable<any[]>;
users$: Observable<any[]>;
constructor(private data: MessageService) {
this.messages$ = data.messages$()
.map(m => m.data)
.map(m => m.reverse());
}
ionic message service
messages$() {
return (<any>this._feathers
.service('messages'))
.watch()
.find({
query: {
$sort: {createdAt: -1},
$limit: 25
}
});
}
ionic feather provider
private _feathers: any;
private _socket: any;
constructor() {
this._socket = io('http://localhost:5050'); // init socket.io
this._feathers = feathers(); // init Feathers
this._feathers.configure(feathersRx({ // add feathers-reactive plugin
idField: '_id'
}));
this._feathers.configure(socketio(this._socket)); // add socket.io plugin
this._feathers.configure(authentication({ // add authentication plugin
storage: window.localStorage
}));
}
// expose services
public service(name: string) {
return this._feathers.service(name);
}
public authenticate(credentials?): Promise<any> {
return this._feathers.authenticate(credentials);
}
doLogin(form: FormGroup) {
this.submitted = true;
if (this.form.valid) {
let loading = this.loadingCtrl.create({
content: 'Loading...'
});
loading.present();
let email = form.value.email;
let password = form.value.password;
this.feather.authenticate({
strategy: 'local',
email,
password
})
.then((res) => {
console.log('Login created.', res)
loading.dismiss();
this.navCtrl.setRoot(TabsPage);
})
.catch(err => {
loading.dismiss();
console.log('Wrong credentials!', err);
let errorMessage = "Email or Password is not match. Please check your login information again."
this.toastCtrl.create({message: errorMessage, duration: 4500})
.present();
});
} else {
let errorMessage = "Invaild email format or password is empty."
this.toastCtrl.create({message: errorMessage, duration: 4500})
.present();
}
}
Would be great, if someone could upgrade feathers to v3.
Any ideas how to fix ?
ERROR in ./~/feathers-hooks/lib/hooks.js
Module not found: Error: Can't resolve 'feathers-hooks-common/lib/populate' in 'c:\temp\feathers-chat-angular\node_modules\feathers-hooks\lib'
@ ./~/feathers-hooks/lib/hooks.js 13:16-61
@ ./src/app/services/feathers.service.ts
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
ERROR in ./~/feathers-hooks/lib/hooks.js
Module not found: Error: Can't resolve 'feathers-hooks-common/lib/bundled' in 'c:\temp\feathers-chat-angular\node_modules\feathers-hooks\lib'
@ ./~/feathers-hooks/lib/hooks.js 15:15-59
@ ./src/app/services/feathers.service.ts
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
"name": "feathers-hooks-common",
"version": "3.6.1",
🚨 You need to enable Continuous Integration on all branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.
I'm not able to run the example.
I get the following error:
ERROR in /Users/michaelbenoit/Projects/javascript/feathers-chat-angular/node_modules/feathers-reactive/index.d.ts (26,13): All declarations of 'Service' must have identical type parameters.
ERROR in /Users/michaelbenoit/Projects/javascript/feathers-chat-angular/node_modules/feathers-hooks/index.d.ts (8,13): All declarations of 'Service' must have identical type parameters.
I created a service wich is using sequelize (mySQL) as Database named 'person'. Once I get the data from Angular application via @feathersjs/feathers it works, but once I delete or patch some data from Postman, feathers returns only the updated data.
Here is returned Object from feathersjs once I patch the Data from Postman, I get Status 200 OK, but in Angular applikation I see only the patched data.
person.hook.js is empty, no hook configured.
Thanks in regards for helping me!
Can this be added?
firstly, i googled and found this error only occur if the service isnt available but in my case, the service exists and i've tested it using postman(localhost:5050/users) and it worked
but everytime i use it with my ionic app i get Error: Timeout of 5000ms exceeded calling create on users. this is a snippet of my code.
Any idea why?
User Service
const Model = createModel(app)
const paginate = app.get('paginate')
const options = {
name: 'users',
Model,
paginate
}
// Initialize our service with any options it requires
app.use('/users', createService(options))
// Get our initialized service so that we can register hooks and filters
const service = app.service('users')
service.hooks(hooks)
if (service.filter) {
service.filter(filters)
}
ionic component
let email = form.value.email;
let password = form.value.password;
this.feathers.service('users')
.create({email, password})
.then((res) => {
loading.dismiss();
console.log('User created.', res)
this.app.getRootNav().setRoot(TabsPage);
})
.catch(err => {
loading.dismiss();
let errorMessage = "An error has occurred, try again later."
this.toastCtrl.create({message: errorMessage, duration: 4500})
.present();
console.log('Could not create user!', err)
});
ionic provider
private _feathers: any;
private _socket: any;
constructor() {
this._socket = io('http://localhost:5050'); // init socket.io
this._feathers = feathers(); // init Feathers
this._feathers.configure(feathersRx({ // add feathers-reactive plugin
idField: '_id'
}));
this._feathers.configure(socketio(this._socket)); // add socket.io plugin
this._feathers.configure(authentication({ // add authentication plugin
storage: window.localStorage
}));
}
// expose services
public service(name: string) {
return this._feathers.service(name);
}
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.