Skip to content

Instantly share code, notes, and snippets.

@rahulsahay19
Created January 11, 2018 04:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rahulsahay19/59b0b0a90d3749bbcd4e2114b97abb96 to your computer and use it in GitHub Desktop.
Save rahulsahay19/59b0b0a90d3749bbcd4e2114b97abb96 to your computer and use it in GitHub Desktop.
app.component.ts
import { Component } from '@angular/core';
import { strictEqual } from 'assert';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
feedStatus = new Promise((resolve,reject)=>{
setTimeout(()=>{
resolve('New Feed!');
},3000)
});
Employees=[
{
name: 'John Cena',
joined: new Date(11,1,2015),
desig:'Developer',
location:'Bangalore'
},
{
name: 'Dave Black',
joined: new Date(2,1,2017),
desig:'Architect',
location:'Bangalore'
},
{
name: 'Rahul Sahay',
joined: new Date(15,5,2017),
desig:'Technical Fellow',
location:'Bangalore'
},
{
name: 'Tom Jakobsen',
joined: new Date(17,4,2017),
desig:'Tech Lead',
location:'Bangalore'
}
]
getEmployees(employee:{name:string, joined:Date,desig:string,location:string }){
return{
'alert-success': employee.name === 'Rahul Sahay',
'alert-warning': employee.name === 'Tom Jakobsen',
'alert-danger': employee.name === 'Dave Black',
'alert-info': employee.name === 'John Cena'
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment