msgCenter -> baMsgCenter

This commit is contained in:
nixa 2016-05-18 17:11:27 +03:00
parent e125febda6
commit 12a1056c12
9 changed files with 41 additions and 17 deletions

View file

@ -0,0 +1,23 @@
import {Component} from '@angular/core';
import {BaMsgCenterService} from './baMsgCenter.service';
import {BaProfilePicturePipe} from '../../pipes';
@Component({
selector: 'msg-center',
providers: [BaMsgCenterService],
styles: [require('./baMsgCenter.scss')],
template: require('./baMsgCenter.html'),
pipes: [BaProfilePicturePipe]
})
export class BaMsgCenter {
public notifications:Array<Object>;
public messages:Array<Object>;
constructor(private _baMsgCenterService:BaMsgCenterService) {
this.notifications = this._baMsgCenterService.getNotifications();
this.messages = this._baMsgCenterService.getMessages();
}
}

View file

@ -1,16 +1,9 @@
import {Component} from '@angular/core';
import {Injectable} from '@angular/core'
import {BaProfilePicturePipe} from '../../pipes';
@Injectable()
export class BaMsgCenterService {
@Component({
selector: 'msg-center',
styles: [require('./msgCenter.scss')],
template: require('./msgCenter.html'),
pipes: [BaProfilePicturePipe]
})
export class MsgCenter {
notifications = [
private _notifications = [
{
name: 'Vlad',
text: 'Vlad posted a new article.',
@ -48,7 +41,7 @@ export class MsgCenter {
}
];
messages = [
private _messages = [
{
name: 'Nasta',
text: 'After you get up and running, you can place Font Awesome icons just about...',
@ -85,4 +78,12 @@ export class MsgCenter {
time: '1 week ago'
}
];
public getMessages():Array<Object> {
return this._messages;
}
public getNotifications():Array<Object> {
return this._notifications;
}
}

View file

@ -0,0 +1 @@
export * from './baMsgCenter.component.ts';

View file

@ -1,5 +1,5 @@
export * from './pageTop';
export * from './msgCenter';
export * from './baMsgCenter';
export * from './sidebar';
export * from './baContentTop';
export * from './baCard';

View file

@ -1 +0,0 @@
export * from './msgCenter.component.ts';

View file

@ -2,14 +2,14 @@ import {Component, ViewEncapsulation} from '@angular/core';
import {AppState} from '../../../app.state';
import {BaProfilePicturePipe} from '../../pipes';
import {MsgCenter} from '../../components/msgCenter';
import {BaMsgCenter} from '../../components/baMsgCenter';
import {BaScrollPosition} from '../../directives';
@Component({
selector: 'page-top',
styles: [require('./pageTop.scss')],
template: require('./pageTop.html'),
directives: [MsgCenter, BaScrollPosition],
directives: [BaMsgCenter, BaScrollPosition],
pipes: [BaProfilePicturePipe],
encapsulation: ViewEncapsulation.None
})

View file

@ -1,5 +1,5 @@
@import '../../sass/conf/conf';
@import '../../components/msgCenter/msgCenter';
@import '../../components/baMsgCenter/baMsgCenter';
.page-top {
background-color: $sidebar;