mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-01-04 00:28:49 +01:00
feat(dashboard): add contacts and room selector components
This commit is contained in:
parent
d351b3d6ff
commit
61869dad7a
18 changed files with 374 additions and 19 deletions
27
src/app/@core/data/data.module.ts
Normal file
27
src/app/@core/data/data.module.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { NgModule, ModuleWithProviders } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
import { UserService } from './users.service';
|
||||
|
||||
const SERVICES = [
|
||||
UserService,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
],
|
||||
providers: [
|
||||
...SERVICES,
|
||||
],
|
||||
})
|
||||
export class DataModule {
|
||||
static forRoot(): ModuleWithProviders {
|
||||
return <ModuleWithProviders>{
|
||||
ngModule: DataModule,
|
||||
providers: [
|
||||
...SERVICES,
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
35
src/app/@core/data/users.service.ts
Normal file
35
src/app/@core/data/users.service.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
|
||||
let counter = 0;
|
||||
|
||||
@Injectable()
|
||||
export class UserService {
|
||||
|
||||
private users = {
|
||||
nick: { name: 'Nick Jones', picture: 'assets/images/nick.png' },
|
||||
eva: { name: 'Eva Moor', picture: 'assets/images/eva.png' },
|
||||
jack: { name: 'Jack Williams', picture: 'assets/images/jack.png' },
|
||||
lee: { name: 'Lee Wong', picture: 'assets/images/lee.png' },
|
||||
alan: { name: 'Alan Thompson', picture: 'assets/images/alan.png' },
|
||||
kate: { name: 'Kate Martinez', picture: 'assets/images/kate.png' },
|
||||
};
|
||||
|
||||
private userArray: any[];
|
||||
|
||||
constructor() {
|
||||
// this.userArray = Object.values(this.users);
|
||||
}
|
||||
|
||||
getUsers() {
|
||||
return this.users;
|
||||
}
|
||||
|
||||
getUserArray() {
|
||||
return this.userArray;
|
||||
}
|
||||
|
||||
getUser() {
|
||||
counter = (counter + 1) % this.userArray.length;
|
||||
return this.userArray[counter];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue