<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
>

<channel>
	<title>Parent - Bipon's Diary</title>
	<atom:link href="https://biponnotes.iglyphic.com/tag/parent/feed/" rel="self" type="application/rss+xml" />
	<link>https://biponnotes.iglyphic.com</link>
	<description>Do good for others. It will come back in unexpected ways.</description>
	<lastBuildDate>Wed, 25 Dec 2019 17:41:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.10</generator>
<site xmlns="com-wordpress:feed-additions:1">168324471</site>	<item>
		<title>Using Template Variables to Interact with Child Components in Angular</title>
		<link>https://biponnotes.iglyphic.com/using-template-variables-to-interact-with-child-components-in-angular/</link>
					<comments>https://biponnotes.iglyphic.com/using-template-variables-to-interact-with-child-components-in-angular/#respond</comments>
		
		<dc:creator><![CDATA[bipon68]]></dc:creator>
		<pubDate>Wed, 25 Dec 2019 12:51:42 +0000</pubDate>
				<category><![CDATA[Angular]]></category>
		<category><![CDATA[Angular Component]]></category>
		<category><![CDATA[angular]]></category>
		<category><![CDATA[Child]]></category>
		<category><![CDATA[Parent]]></category>
		<guid isPermaLink="false">https://bipon.me/?p=213</guid>

					<description><![CDATA[<p>Step1: events-app.component.ts file Step2: events-list.component.ts file Step3: events-thumbnail.component.ts file app.module.ts file (Register events component, event list component and event thumbnail component in angular module ) index.html file</p>
<p>The post <a href="https://biponnotes.iglyphic.com/using-template-variables-to-interact-with-child-components-in-angular/">Using Template Variables to Interact with Child Components in Angular</a> first appeared on <a href="https://biponnotes.iglyphic.com">Bipon's Diary</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Step1: events-app.component.ts file</p>



<pre class="wp-block-code"><code>import { Component } from '@angular/core';

@Component({
  selector: 'events-app',
  template: `
    &lt;events-list>&lt;/events-list>
  `
})
export class EventsAppComponent {
  title = 'ng-fundamentals';
}</code></pre>



<p> Step2: events-list.component.ts file </p>



<pre class="wp-block-code"><code>import { Component } from '@angular/core';

@Component({
    selector: "events-list",
    template: `
    &lt;div>
    &lt;h2>Upcoing Angular Evnets&lt;/h2>
        &lt;hr>
        &lt;event-thumbnail #thumbnail [event]="event1">&lt;/event-thumbnail>
        &lt;h4>{{thumbnail.someProperty}}&lt;/h4>
        &lt;button class="btn btn-primary" (click)="thumbnail.logFoo()">Log me some foo &lt;/button>
    &lt;/div>
    `
})


export class EventListComponent{

    event1 = {
        id: 1,
        name: 'Angular Connect',
        date: '9/27/2019',
        time: '10:00 am',
        price: 999.90,
        imageUrl: '/assets/images/angularconnect-shield.png',
        location: {
            address: '1047 DT',
            city: 'London',
            country: 'England'
        }
    }
}</code></pre>



<p>  Step3: events-thumbnail.component.ts file  </p>



<pre class="wp-block-code"><code>import { Component, Input, Output, EventEmitter } from '@angular/core';

@Component({
    selector: 'event-thumbnail',
    template: `        
        &lt;div class="well thumbnail">
            &lt;h2>{{event.name}}&lt;/h2>
            &lt;div>Date: {{event.date}}&lt;/div>
            &lt;div>price: \${{event.price}}&lt;/div>
            &lt;div>time: {{event.time}}&lt;/div>
            &lt;div>
                &lt;span>Location: {{event.location.address}}&lt;/span>
                &lt;span> &lt;/span>
                &lt;span>{{event.location.city}}, {{event.location.country}}&lt;/span>
            &lt;/div>
            
        &lt;/div>

    `
})

export class EventThumbnailComponent{
    @Input() event: any;
    someProperty:any = "some value";

    logFoo(){
        console.log('foo');
    }
}</code></pre>



<p>app.module.ts file (Register events component, event list component and event thumbnail component in angular module )</p>



<pre class="wp-block-code"><code>import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { EventsAppComponent } from './events-app.component';
import { EventListComponent } from './events/event-list.component';
import { EventThumbnailComponent } from './events/event-thumbnail.component';

@NgModule({
  declarations: [
    EventsAppComponent,
    EventListComponent,
    EventThumbnailComponent
  ],
  imports: [
    BrowserModule
  ],
  providers: [],
  bootstrap: [EventsAppComponent]
})
export class AppModule { }
</code></pre>



<p>index.html file</p>



<pre class="wp-block-code"><code>&lt;!doctype html>
&lt;html lang="en">
&lt;head>
  &lt;meta charset="utf-8">
  &lt;title>Ng Fundamentals&lt;/title>
  &lt;base href="/">

  &lt;meta name="viewport" content="width=device-width, initial-scale=1">
  &lt;link rel="icon" type="image/x-icon" href="favicon.ico">
&lt;/head>
&lt;body>
  &lt;div class="container">
    &lt;events-app>&lt;/events-app>
  &lt;/div>
  
&lt;/body>
&lt;/html></code></pre>


<p><!--EndFragment--></p><p>The post <a href="https://biponnotes.iglyphic.com/using-template-variables-to-interact-with-child-components-in-angular/">Using Template Variables to Interact with Child Components in Angular</a> first appeared on <a href="https://biponnotes.iglyphic.com">Bipon's Diary</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://biponnotes.iglyphic.com/using-template-variables-to-interact-with-child-components-in-angular/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">213</post-id>	</item>
		<item>
		<title>Communicating with Parent Components in Angular</title>
		<link>https://biponnotes.iglyphic.com/communicating-with-parent-components-in-angular/</link>
					<comments>https://biponnotes.iglyphic.com/communicating-with-parent-components-in-angular/#respond</comments>
		
		<dc:creator><![CDATA[bipon68]]></dc:creator>
		<pubDate>Wed, 25 Dec 2019 11:41:46 +0000</pubDate>
				<category><![CDATA[Angular]]></category>
		<category><![CDATA[Angular Component]]></category>
		<category><![CDATA[angular]]></category>
		<category><![CDATA[Child]]></category>
		<category><![CDATA[Parent]]></category>
		<guid isPermaLink="false">https://bipon.me/?p=209</guid>

					<description><![CDATA[<p>Step1: events-app.component.ts file Step2: events-list.component.ts file Step3: events-thumbnail.component.ts file app.module.ts file (Register events component, event list component and event thumbnail component in angular module ) index.html file</p>
<p>The post <a href="https://biponnotes.iglyphic.com/communicating-with-parent-components-in-angular/">Communicating with Parent Components in Angular</a> first appeared on <a href="https://biponnotes.iglyphic.com">Bipon's Diary</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><!--StartFragment--></p>


<p>Step1: events-app.component.ts file</p>



<pre class="wp-block-code"><code>import { Component } from '@angular/core';

@Component({
  selector: 'events-app',
  template: `
    &lt;events-list>&lt;/events-list>
  `
})
export class EventsAppComponent {
  title = 'ng-fundamentals';
}</code></pre>



<p> Step2: events-list.component.ts file </p>



<pre class="wp-block-code"><code>import { Component } from '@angular/core';

@Component({
    selector: "events-list",
    template: `
    &lt;div>
    &lt;h2>Upcoing Angular Evnets&lt;/h2>
        &lt;hr>
        &lt;event-thumbnail (eventClick)="handleEventClicked($event)"
            [event]="event1">&lt;/event-thumbnail>
    &lt;/div>
    `
})


export class EventListComponent{

    event1 = {
        id: 1,
        name: 'Angular Connect',
        date: '9/27/2019',
        time: '10:00 am',
        price: 999.90,
        imageUrl: '/assets/images/angularconnect-shield.png',
        location: {
            address: '1047 DT',
            city: 'London',
            country: 'England'
        }
    }

    handleEventClicked(data){
        console.log('data : ', data);
    }

}</code></pre>



<p>  Step3: events-thumbnail.component.ts file  </p>



<pre class="wp-block-code"><code>import { Component, Input, Output, EventEmitter } from '@angular/core';

@Component({
    selector: 'event-thumbnail',
    template: `        
        &lt;div class="well thumbnail">
            &lt;h2>{{event.name}}&lt;/h2>
            &lt;div>Date: {{event.date}}&lt;/div>
            &lt;div>price: \${{event.price}}&lt;/div>
            &lt;div>time: {{event.time}}&lt;/div>
            &lt;div>
                &lt;span>Location: {{event.location.address}}&lt;/span>
                &lt;span> &lt;/span>
                &lt;span>{{event.location.city}}, {{event.location.country}}&lt;/span>
            &lt;/div>
            &lt;button class="btn btn-primary" (click)="handleClickMe()">click me &lt;/button>
        &lt;/div>

    `
})

export class EventThumbnailComponent{
    @Input() event: any;
    @Output() eventClick = new EventEmitter()

    handleClickMe(){
        this.eventClick.emit(this.event.name);
        // console.log('Click me');
    }
}</code></pre>



<p>app.module.ts file (Register events component, event list component and event thumbnail component in angular module )</p>



<pre class="wp-block-code"><code>import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { EventsAppComponent } from './events-app.component';
import { EventListComponent } from './events/event-list.component';
import { EventThumbnailComponent } from './events/event-thumbnail.component';

@NgModule({
  declarations: [
    EventsAppComponent,
    EventListComponent,
    EventThumbnailComponent
  ],
  imports: [
    BrowserModule
  ],
  providers: [],
  bootstrap: [EventsAppComponent]
})
export class AppModule { }
</code></pre>



<p>index.html file</p>



<pre class="wp-block-code"><code>&lt;!doctype html>
&lt;html lang="en">
&lt;head>
  &lt;meta charset="utf-8">
  &lt;title>Ng Fundamentals&lt;/title>
  &lt;base href="/">

  &lt;meta name="viewport" content="width=device-width, initial-scale=1">
  &lt;link rel="icon" type="image/x-icon" href="favicon.ico">
&lt;/head>
&lt;body>
  &lt;div class="container">
    &lt;events-app>&lt;/events-app>
  &lt;/div>
  
&lt;/body>
&lt;/html></code></pre>


<p><!--EndFragment--></p><p>The post <a href="https://biponnotes.iglyphic.com/communicating-with-parent-components-in-angular/">Communicating with Parent Components in Angular</a> first appeared on <a href="https://biponnotes.iglyphic.com">Bipon's Diary</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://biponnotes.iglyphic.com/communicating-with-parent-components-in-angular/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">209</post-id>	</item>
	</channel>
</rss>
