Last active
October 10, 2016 09:26
-
-
Save andreisebastianc/87f0cf0e8ed095a1e891d7335630081f to your computer and use it in GitHub Desktop.
Revisions
-
andreisebastianc revised this gist
Oct 10, 2016 . 1 changed file with 27 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ import { Component } from "@angular/core"; interface User { name: string; image: string; fullname: string; } @Component({ selector: 'app', template: ` <div class="app-wrapper">Hi, I'm working!</div> <user-profile [profile]="user"></user-profile> ` }) export class App { user: User constructor() { this.user = { name:"test", image:"/public/default-user-profile.jpg", fullname: "test test test" }; } } -
andreisebastianc created this gist
Oct 10, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ import { Component, Input } from '@angular/core'; interface Profile { name: string; image: string; } @Component({ selector: 'user-profile', template: ` <div *ngIf="profile"> <div class="profile"> <img class="profile-image" src={{profile.image}} /> <span class="profile-name">{{profile.name}}</span> </div> </div> ` }) export class UserProfileComponent { @Input() profile: Profile; }