<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Bipon Biswas on Medium]]></title>
        <description><![CDATA[Stories by Bipon Biswas on Medium]]></description>
        <link>https://medium.com/@bipon68?source=rss-cd17e88e5eac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*wHdP4H9v8__5K_AYHFCazg.jpeg</url>
            <title>Stories by Bipon Biswas on Medium</title>
            <link>https://medium.com/@bipon68?source=rss-cd17e88e5eac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 12:25:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bipon68/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Angular Custom Directive]]></title>
            <link>https://medium.com/@bipon68/angular-custom-directive-1cc069b815b1?source=rss-cd17e88e5eac------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cc069b815b1</guid>
            <category><![CDATA[custom-directive]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[directives]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Bipon Biswas]]></dc:creator>
            <pubDate>Thu, 09 Apr 2020 02:30:11 GMT</pubDate>
            <atom:updated>2020-04-09T02:30:11.932Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y3iE8ovdDMda9zg7qwl5LA.jpeg" /><figcaption>Custom Directive</figcaption></figure><p><strong>Objective</strong>: In this article, you will learn how to create a custom directive.</p><p><strong>Pre-requisite</strong> Prior to completing this article, you should have already installed all pre-requisite tooling including: Visual Studio Code, Node Package Manager (NPM), Node, Angular CLI.</p><h4>Setup</h4><ol><li>On your local machine, open <strong>Visual Studio Code</strong>.</li><li>Go to the <strong>File</strong> menu and select the <strong>Open Folder</strong> option.</li><li>Create a new project for this exercise and <em>select</em> this folder.</li><li>Create a new project command: <strong>ng new angular-medium</strong></li><li>Create a new project: open terminal by <strong>Ctrl + backtic(`)</strong> key then run <strong>ng new angular-medium </strong>command</li></ol><h4>Bootstrapping Your Environment</h4><ol><li>In Visual Studio Code, <strong>Ctrl + backtic(`)</strong> key press and select the <strong>Open in Terminal</strong> option.</li><li>Run the <strong>angular-medium project </strong>using npm:</li></ol><pre>npm start</pre><p>Now you can see the project from here. This is default url.</p><pre><a href="http://localhost:4200/">http://localhost:4200/</a></pre><p>To add a directive.</p><pre>ng g d test</pre><p>installing directive</p><pre>create src/app/test.directive.spec.ts<br>create src/app/test.directive.ts<br>update src/app/app.module.ts</pre><p>or also you can create a <strong>test</strong> directive with a folder</p><pre>ng g d bipon/test</pre><p><strong>test.directive.ts </strong>look like this</p><pre>import { Directive } from &#39;<a href="http://twitter.com/angular/core">@angular/core</a>&#39;;</pre><pre><a href="http://twitter.com/Directive">@Directive</a>({<br>  selector: &#39;[appTest]&#39;<br>})<br>export class TestDirective {</pre><pre>constructor() { }</pre><pre>}</pre><p>when run this command <strong>ng g d testdirective </strong>then update<strong> app.module.ts file. </strong>Added <strong>TestDirective </strong>automatically</p><pre>import { BrowserModule } from &#39;<a href="http://twitter.com/angular/platform-browser">@angular/platform-browser</a>&#39;;<br>import { NgModule } from &#39;<a href="http://twitter.com/angular/core">@angular/core</a>&#39;;<br>import {FormsModule} from &#39;<a href="http://twitter.com/angular/forms">@angular/forms</a>&#39;;</pre><pre>import { AppComponent } from &#39;./app.component&#39;;<br>import { SampleService } from &#39;./sample.service&#39;;</pre><pre>import { TestDirective } from &#39;./bipon/test.directive&#39;;</pre><pre><a href="http://twitter.com/NgModule">@NgModule</a>({<br>  declarations: [<br>    AppComponent,<br>    TestDirective,<br>  ],<br>  imports: [<br>    BrowserModule,<br>    FormsModule,<br>  ],<br>  providers: [SampleService],<br>  bootstrap: [AppComponent]<br>})<br>export class AppModule { }</pre><p><strong>test.directive.ts</strong></p><p>Update the directive file. All logic write here</p><pre><a href="http://twitter.com/Directive">@Directive</a>({<br>  selector: &#39;[test-directive]&#39;<br>})<br>export class TestDirective {</pre><pre>constructor() { }</pre><pre><a href="http://twitter.com/HostListener">@HostListener</a>(&#39;window:keydown&#39;, [&#39;$event&#39;])<br>  handleKeyDown(event: KeyboardEvent){<br>    console.log(&#39;event: &#39;, event)<br>  }<br>}</pre><p>Now time to implement this directive. Added input field in app.component.html file</p><pre>&lt;input type=&quot;text&quot; test-directive&quot; /&gt;</pre><p>if any character type into input field then showing output in console log.</p><p><strong>Output</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*o7LF8FJMiMLGuNiBrkEzWg.png" /></figure><p><strong>#Another example</strong></p><p><strong>app.component.html</strong></p><pre>&lt;p [test-directive]=&quot;color&quot;&gt;Highlight me!&lt;/p&gt;<br>&lt;p [test-directive]=&quot;color&quot; defaultColor=&quot;violet&quot;&gt;<br>  Highlight me too!<br>&lt;/p&gt;</pre><pre>&lt;hr&gt;<br>&lt;p&gt;&lt;i&gt;Mouse over the following lines to see fixed highlights&lt;/i&gt;&lt;/p&gt;<br>&lt;p [test-directive]=&quot;&#39;yellow&#39;&quot;&gt;Highlighted in yellow&lt;/p&gt;<br>&lt;p [test-directive]=&quot;&#39;orange&#39;&quot;&gt;Highlighted in orange&lt;/p&gt;</pre><p><strong>test.directive.ts</strong></p><pre>constructor(private el: ElementRef) { }<br>  <a href="http://twitter.com/Input">@Input</a> () defaultColor: string;<br>  <a href="http://twitter.com/Input">@Input</a>(&#39;test-directive&#39;) hightlightColor: string;</pre><pre><a href="http://twitter.com/HostListener">@HostListener</a>(&#39;window:keydown&#39;, [&#39;$event&#39;]) KeyboardEvent(event: any){<br>    console.log(&#39;event: &#39;, event);<br>    this.highlight(this.hightlightColor || this.defaultColor || &#39;cyan&#39;);<br>  }<br><a href="http://twitter.com/HostListener">@HostListener</a>(&#39;blur&#39;) KeyboardEventLeve(){<br>    this.highlight(null);<br>  }</pre><pre>public highlight(color: string){<br>    this.el.nativeElement.style.backgroundColor = color;<br>}</pre><p>Output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*xECoxbi69yjNN28MyQ6CkQ.png" /></figure><p><a href="https://stackblitz.com/github/bipon68/angular-medium">Source Code</a></p><p><strong>Reference</strong></p><p><a href="https://angular.io/cli">angular-cli</a></p><p><a href="https://riptutorial.com/angular-cli/example/29977/generating-directives">generating directive</a></p><p><a href="https://angular.io/guide/attribute-directives">angular-directive</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cc069b815b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Functions and callbacks]]></title>
            <link>https://medium.com/@bipon68/functions-and-callbacks-cd55914817ec?source=rss-cd17e88e5eac------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd55914817ec</guid>
            <category><![CDATA[function]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[callback]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Bipon Biswas]]></dc:creator>
            <pubDate>Thu, 09 Apr 2020 01:44:31 GMT</pubDate>
            <atom:updated>2020-04-09T01:44:31.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-YD6B3Mdz_-IX5vNnOE1IA.jpeg" /><figcaption>Functions and callbacks</figcaption></figure><p>Let’s see how to declare a function and a callback.</p><h4>Functions</h4><p>There are two ways to declare a function.</p><h4>1 — Standard function declaration 👀</h4><p>We’ve seen that functions can be declared using this syntax:</p><pre>function functionName(parameters) {<br>// code to be executed<br>}</pre><p>A function declared this way can be called like this:</p><pre>functionName(parameters);</pre><p><strong>Notice</strong> that we do not add a semicolon at the end of a function declaration. Semicolons are used to separate executable JavaScript statements, and a function declaration is not an executable statement.</p><p>Here is an example:</p><pre>function sum(a, b) {<br>  // this function returns a result<br>  return (a + b);<br>}</pre><pre>function displayInPage(message, value) {<br>  // this function does not return anything<br>  document.body.innerHTML += message + value + &quot;&lt;br&gt;&quot;;<br>}</pre><pre>var result = sum(3, 4);<br>displayInPage(&quot;Result: &quot;, result);</pre><pre>// we could have written this<br>displayInPage(&quot;Result: &quot;, sum(10, 15));</pre><p>Output</p><pre>Result: 7<br>Result: 25</pre><p><a href="https://codepen.io/bipon68/pen/rNVEbBd">Codepen source</a></p><p>In the above example, the <strong>sum</strong> function returns a value, and the <strong>displayInPage</strong> function does not return anything.</p><h4>2 — Use a function expression 👀</h4><p>A JavaScript function can also be defined using an expression that can be stored in a variable. Then, the variable can be used as a function:</p><p>Here is a typical example:</p><pre>var sum = function(a, b) {<br>  return (a + b);<br>};</pre><pre>var displayInPage = function(message, value) {<br>  // this function does not return anything<br>  document.body.innerHTML += message + value + &quot;&lt;br&gt;&quot;;<br>};</pre><pre>var result = sum(3, 4);<br>displayInPage(&quot;Result: &quot;, result);</pre><pre>// we could have written this<br>displayInPage(&quot;Result: &quot;, sum(10, 15));</pre><p>Output</p><pre>Result: 7<br>Result: 25</pre><p><a href="https://codepen.io/bipon68/pen/PoqrgqP">Codepen source</a></p><p><strong>Notice</strong> how the <strong>sum </strong>and <strong>displayInPage</strong> functions have been declared. We used a variable to store the function expression, then we can call the functions using the variable name. And we added a semicolon at the end, since we executed a JavaScript instruction, giving a value to a variable.</p><p>The <strong>“function expression”</strong> is an <strong>“anonymous function”</strong>, a function without a name, that represents a value that can be assigned to a variable. Then, the variable can be used to execute the function.</p><p>We say that functions are <strong>“first class objects”</strong> which can be manipulated like any other <strong>object/value</strong> in JavaScript.</p><p>This means that functions can also be used as parameters to other functions. In this case they are called <strong>“callbacks”</strong>.</p><h3>Callbacks</h3><p>Indeed, as functions are <strong>first-class objects</strong>, we can pass a function as an argument, as a parameter to another function and later execute that passed-in function or even return it to be executed later. When we do this, we talk about <em>callback functions</em> in JavaScript: a function passed to another function, and executed inside the function we called.</p><p>All the examples of event listeners that you’ve seen used callback functions. Here is another one that registers mouse click listeners on the window object (the window objects represent the whole HTML document):</p><pre>// Add a click event listener on the whole document<br>// the testClick function is a callback:<br>// a function called by the browser when a click event is detected<br>window.addEventListener(&quot;click&quot;, testClick);</pre><pre>function testClick(event) {<br>  document.body.innerHTML += &quot;WOW! Button clicked&lt;br&gt;&quot;;<br>}</pre><pre>// We could have written this, with the body of the callback as an argument of the addEventListener function<br>window.addEventListener(&quot;click&quot;, function (evt) {<br>  document.body.innerHTML += &quot;WOW! Button clicked version 2&lt;br&gt;&quot;;<br>});</pre><p>Output:</p><pre>WOW! Button clicked<br>WOW! Button clicked version 2</pre><p><a href="https://codepen.io/bipon68/pen/dyoBLMB">Codepen source</a></p><p>In this case, the testClick function is passed as a parameter to the addEventListener method/function.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd55914817ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular: Create a custom dependency injection]]></title>
            <link>https://medium.com/@bipon68/angular-create-a-custom-dependency-injection-4fd50d84ef42?source=rss-cd17e88e5eac------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fd50d84ef42</guid>
            <category><![CDATA[custom]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[dependency-injection]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Bipon Biswas]]></dc:creator>
            <pubDate>Fri, 20 Mar 2020 20:38:23 GMT</pubDate>
            <atom:updated>2020-04-09T14:20:11.294Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*YK_zIoFUTf1Pxm2kqdh47Q.jpeg" /><figcaption>Create a custom dependency injection in Angular</figcaption></figure><p><strong>Objective</strong>: In this article, you will know dependency injection concept, custom dependency injection in Angular.</p><p><strong>Pre-requisite</strong> Prior to completing this article, you should have already installed all pre-requisite tooling including: Visual Studio Code, Node Package Manager (NPM), Node, Angular CLI.</p><ol><li>create a property named <strong>dependencyTitle </strong>into <strong>app.component.ts</strong> file</li></ol><pre>public dependencyTitle: string;</pre><p>2. So we’re gonna create a public constructor. And <strong>this.dependencyTitle</strong>=<br>“hello! Mahfuz Shazol”</p><pre>constructor() {  <br>    this.dependencyTitle = &quot;Hello! Mahfuz Shazol&quot;<br>}</pre><p>3. Go to <strong>app.component.html</strong>, we want to bind this <strong>p</strong> to the value of the title. So whatever is in that <strong>dependencyTitle </strong>property is want to show as our <strong>p</strong>, that’s enough.</p><pre>&lt;p&gt;{{dependencyTitle}}&lt;/p&gt;</pre><p>Now we want get our messages to show in this title from a <strong>service</strong>, or some type of <strong>dependency </strong>class. So we want separate the responsibilities of our<br>application.</p><p>4. So the first thing we want do is we want to create a class. Create a new file in this app folder named <strong>test.message.ts</strong></p><pre>export class MessageProvider{<br>    public getMessage(): string{<br>        return &quot;Hey! Mahfuz Shazol&quot;<br>    }<br>}</pre><p>5. Now class can be injected into an Angular component. So the first thing we have to import a class <strong>decorator </strong>called <strong>injectable</strong> from <strong>Angular/core</strong>.</p><pre>import { Injectable } from &#39;<a href="http://twitter.com/angular/core">@angular/core</a>&#39;;</pre><pre><a href="http://twitter.com/Injectable">@Injectable</a>()<br>export class MessageProvider{<br>    public getMessage(): string{<br>        return &quot;Hey! Mahfuz Shazol&quot;<br>    }<br>}</pre><p>This basically says that this could be injected into components throughout Angular application.</p><p>To make it available for injection, we need to use this array right here.</p><p>6. Import <strong>messageProvider </strong>into<strong> app.module.ts</strong></p><pre>import { MessageProvider } from &#39;./test.message&#39;;</pre><pre><a href="http://twitter.com/NgModule">@NgModule</a>({<br>  declarations: [<br>    AppComponent,<br>  ],<br>  imports: [<br>    BrowserModule<br>  ],<br>  providers: [SampleService, MessageProvider],<br>  bootstrap: [AppComponent]<br>})<br>export class AppModule { }</pre><p>Now we have this file ready to go.</p><p>7. Go to our <strong>app.component.ts</strong> . Import our <strong>messageProvider</strong></p><pre>import { MessageProvider } from &#39;./test.message&#39;;</pre><p>8. Go ahead and use the <strong>messageProvider . </strong>Because we’re not using this provider outside of this class.</p><pre>constructor(private _messageProvider: MessageProvider) {  <br>      this.dependencyTitle = _messageProvider.getMessage();<br>}</pre><p>And finally we’re using our <strong>messageProvider </strong>and our constructor, so we’re <strong>injecting </strong>these <strong>dependencies</strong>, that looks great too.</p><p><strong>Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*uLgvK_9zShG2bU9Lvh3Q4Q.png" /></figure><p><a href="https://github.com/bipon68/angular-medium"><strong>Github URL</strong></a></p><p><a href="https://stackblitz.com/github/bipon68/angular-medium"><strong>StackBlitz URL</strong></a></p><p><strong>## Reference</strong></p><p><a href="https://scrimba.com/g/gintrototypescript">TypeScript</a></p><p><a href="https://angular.io/cli">Angular CLI</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fd50d84ef42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dependency Injection Concept]]></title>
            <link>https://medium.com/@bipon68/dependency-injection-concept-5c6604a778e6?source=rss-cd17e88e5eac------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c6604a778e6</guid>
            <category><![CDATA[dependency-injection]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[concept]]></category>
            <dc:creator><![CDATA[Bipon Biswas]]></dc:creator>
            <pubDate>Fri, 20 Mar 2020 20:22:45 GMT</pubDate>
            <atom:updated>2020-03-20T20:22:45.304Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iVv6g_5jbeQXOl3j_KpHGQ.jpeg" /></figure><p><strong>Objective</strong>: In this article, you will know dependency injection concept.</p><p><strong>Pre-requisite</strong> Prior to completing this article, you should have already installed all pre-requisite tooling including: Visual Studio Code, Node Package Manager (NPM), Node.</p><p>Add <strong>app.ts</strong> file into any folder</p><p>Just going to create a very simple application</p><ol><li>Create a export class <strong>MainPage </strong>then we’ll just create a new <strong>instance </strong>of MainPage.</li></ol><pre>export class MainPage {</pre><pre>}<br>var page = new MainPage();</pre><p>2. Now want to create a constructor. And in this constructor we’re going to simply get a list of items.</p><pre>export class MainPage {<br>    constructor(){<br>        var items = [&#39;Apple&#39;, &#39;Mango&#39;, &#39;Miew&#39;];<br>        console.log(&#39;[Item shows]&#39;  + items );<br>    }<br>}<br>var page = new MainPage();</pre><p>3. Open this in our command prompt and simply run the TypeScript compiler using app.ts.</p><pre>tsc app.ts </pre><p>Then create a <strong>app.js</strong> file into this folder.</p><p>4. Run this as a node application, so node app.js.</p><pre>node app.js</pre><p>Then showing look like this. Output: [Item shows]Apple,Mango,Miew</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*qHQ4Izdw-kYLNSDFiQVuWg.png" /></figure><p>5. Create an ItemService class</p><pre>export class ItemService {<br>    public getItems(): string[]{<br>        return [&#39;Apple&#39;, &#39;Mango&#39;, &#39;Miew&#39;]<br>    }<br>}</pre><p>6. update MainPage class</p><pre>export class MainPage {<br>    public items: string[];<br>    constructor(private _itemService: ItemService){<br>        this.items = _itemService.getItems();;<br>        console.log(&#39;[Item shows]&#39;  + this.items );<br>    }<br>}</pre><p>7. TypeScript compile this again</p><pre>tsc app.ts</pre><p>8. Run the application again</p><pre>node app.js</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*qHQ4Izdw-kYLNSDFiQVuWg.png" /></figure><p>There’s no functional change in application, but we changed the way the application is structured.</p><p>Now we want to create our own <strong>logger</strong> class. We can go in, export class <strong>logger</strong>, and in here we’ll just create a method called log message.</p><p>We know we need our title and we need our message</p><p>9. Create a Logger class</p><pre>export class Logger {<br>    public logMessage(title: string, message: any){<br>        console.log(&#39;[&#39; + title + &#39;]&#39; + message);<br>    }<br>}</pre><p>10. Update Mainpage class</p><pre>export class MainPage {<br>    public items: string[];<br>    constructor(private _logger : Logger, private _itemService: ItemService){<br>        this.items = _itemService.getItems();;<br>        _logger.logMessage(&#39;Items shows &#39;, this.items)<br>        // console.log(&#39;[Item shows] &#39;  + this.items );<br>    }<br>}</pre><p>11. TypeScript, compile this again. Run the application again</p><pre>tsc app.ts then node app.js</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*qHQ4Izdw-kYLNSDFiQVuWg.png" /></figure><p>So we haven’t changed the functionality application, we just restructured it so it’s a little bit easier to understand what’s our <strong>dependencies</strong>.</p><p>We separated everything out into unit to work. Make it a little bit easier to manage this application but we can still go a step further.</p><p>12. We can start implementing interfaces, so we can say implements the <strong>ILogger </strong>interface here</p><pre>export interface ILogger {<br>    logMessage(title: string, message: any);<br>}</pre><p>Also update <strong>Logger </strong>class</p><pre>export class Logger implements ILogger {<br>    public logMessage(title: string, message: any){<br>        console.log(&#39;[&#39; + title + &#39;]&#39; + message);<br>    }<br>}</pre><p>13. Also we can start implementing interfaces, so we can say implements the <strong>IItemService </strong>interface here</p><pre>export interface IItemService {<br>    getItems(): string[]<br>}</pre><p>Also update <strong>ItemService </strong>class</p><pre>export class ItemService implements IItemService{<br>    public getItems(): string[]{<br>        return [&#39;Apple&#39;, &#39;Mango&#39;, &#39;Miew&#39;]<br>    }<br>}</pre><p>14. Also update MainPage class</p><pre>export class MainPage {<br>    public items: string[];<br>    constructor(private _logger : ILogger, private _itemService: IItemService){<br>        this.items = _itemService.getItems();;<br>        _logger.logMessage(&#39;Items shows &#39;, this.items)<br>        // console.log(&#39;[Item shows] &#39;  + this.items );<br>    }<br>}</pre><p>So now we are not directly dependent on these implementations or logger items service, we’re only depending on anything that implements the interface.</p><p>15. So again tsc app.ts, node app.js</p><pre>tsc app.ts then node app.js</pre><p>Functionality still has not changed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*qHQ4Izdw-kYLNSDFiQVuWg.png" /></figure><p>So if I want to create a new item service, so Apple Mango Miew, I might wanna say, alt item service.</p><p>16. We don’t have to change the MainPage class. We don’t have to change the interface. The only difference here is we pass in the alt item service</p><pre>export class AltItemService implements IItemService{<br>    public getItems(): string[]{<br>        return [&#39;Panda&#39;, &#39;Fox&#39;, &#39;Dog&#39;]<br>    }<br>}<br>var page = new MainPage( new Logger(), new AltItemService());</pre><p>So again tsc app.ts, node app.js</p><pre>tsc app.ts then node app.js</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*q29IUl25NaQ8vELTANXUFw.png" /></figure><p>And we see that we have now used a new item service without changing our main page application. So using the dependency injection, we can make our application structure a lot more sophisticated, a lot more easier to use for developers who can understand the different components of our application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c6604a778e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[করোনাভাইরাস রোগ (COVID-19) জনসাধারণের জন্য পরামর্শ]]></title>
            <link>https://medium.com/@bipon68/%E0%A6%95%E0%A6%B0%E0%A7%8B%E0%A6%A8%E0%A6%BE%E0%A6%AD%E0%A6%BE%E0%A6%87%E0%A6%B0%E0%A6%BE%E0%A6%B8-%E0%A6%B0%E0%A7%8B%E0%A6%97-covid-19-%E0%A6%9C%E0%A6%A8%E0%A6%B8%E0%A6%BE%E0%A6%A7%E0%A6%BE%E0%A6%B0%E0%A6%A3%E0%A7%87%E0%A6%B0-%E0%A6%9C%E0%A6%A8%E0%A7%8D%E0%A6%AF-%E0%A6%AA%E0%A6%B0%E0%A6%BE%E0%A6%AE%E0%A6%B0%E0%A7%8D%E0%A6%B6-5cde61a25087?source=rss-cd17e88e5eac------2</link>
            <guid isPermaLink="false">https://medium.com/p/5cde61a25087</guid>
            <category><![CDATA[safety]]></category>
            <category><![CDATA[advice]]></category>
            <category><![CDATA[health]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[corona]]></category>
            <dc:creator><![CDATA[Bipon Biswas]]></dc:creator>
            <pubDate>Thu, 19 Mar 2020 18:38:24 GMT</pubDate>
            <atom:updated>2020-03-19T18:38:24.614Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WsVQw7LKwHpmPy7QySh5dQ.jpeg" /></figure><h4>নতুন করোনভাইরাসের বিরুদ্ধে প্রাথমিক সুরক্ষা ব্যবস্থা</h4><p><a href="https://www.youtube.com/channel/UC07-dOwgza1IguKA86jqxNA">World Health Organization (WHO)</a>-র ওয়েবসাইটে এবং আপনার জাতীয় এবং স্থানীয় জনস্বাস্থ্য কর্তৃপক্ষের মাধ্যমে পাওয়া COVID-19 প্রাদুর্ভাবের সর্বশেষ তথ্য সম্পর্কে সচেতন থাকুন সংক্রামিত বেশিরভাগ লোকেরা হালকা অসুস্থতার অভিজ্ঞতা পান এবং পুনরুদ্ধার করেন তবে এটি অন্যদের জন্য আরও গুরুতর হতে পারে। আপনার স্বাস্থ্যের যত্ন নিন এবং নিম্নলিখিতগুলি করে অন্যকে সুরক্ষা দিন:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FbPITHEiFWLc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DbPITHEiFWLc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FbPITHEiFWLc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e41f53aeeb2b22b545b5a8b584f697ff/href">https://medium.com/media/e41f53aeeb2b22b545b5a8b584f697ff/href</a></iframe><h4>ঘন ঘন আপনার হাত ধুয়ে নিন</h4><p>অ্যালকোহল ভিত্তিক হাত ঘষে আপনার হাত নিয়মিত এবং পুঙ্খানুপুঙ্খভাবে পরিষ্কার করুন বা সাবান এবং জলে ধুয়ে ফেলুন।</p><p><strong>কেন? </strong>সাবান ও জল দিয়ে আপনার হাত ধোয়া বা অ্যালকোহল-ভিত্তিক হাত ঘষা ব্যবহার আপনার হাতের ভাইরাসকে মেরে ফেলে।</p><h4>সামাজিক দূরত্ব বজায় রাখুন</h4><p>নিজের এবং কাশি বা হাঁচি হয় এমন কারও মধ্যে কমপক্ষে 1 মিটার (3 ফুট) দূরত্ব বজায় রাখুন।</p><p><strong>কেন? </strong>যখন কেউ কাশি বা হাঁচি দেয় তখন তারা তাদের নাক বা মুখ থেকে ছোট তরল ফোঁটা স্প্রে করে যার মধ্যে ভাইরাস থাকতে পারে। যদি আপনি খুব কাছাকাছি থাকেন, তবে আপনি COVID-19 ভাইরাস সহ ফোঁটাগুলিতে শ্বাস নিতে পারেন যদি কাশি ব্যক্তির এই রোগ হয় ।</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F6Ooz1GZsQ70%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6Ooz1GZsQ70&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F6Ooz1GZsQ70%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a50d297de4ccd044b8e1c5acd1769177/href">https://medium.com/media/a50d297de4ccd044b8e1c5acd1769177/href</a></iframe><h4>চোখ, নাক এবং মুখ স্পর্শ করা এড়িয়ে চলুন</h4><p><strong>কেন? </strong>হাতগুলি অনেকগুলি পৃষ্ঠকে স্পর্শ করে এবং ভাইরাস তুলতে পারে। দূষিত হয়ে গেলে, হাতগুলি আপনার চোখ, নাক বা মুখে ভাইরাস স্থানান্তর করতে পারে। সেখান থেকে ভাইরাসটি আপনার দেহে প্রবেশ করতে পারে এবং আপনাকে অসুস্থ করতে পারে।</p><h4>শ্বাস প্রশ্বাসের হাইজিন অনুশীলন করুন</h4><p>নিশ্চিত হোন যে আপনি এবং আপনার চারপাশের লোকেরা ভাল শ্বাস প্রশ্বাসের হাইজিন অনুসরণ করেন। এর অর্থ আপনি যখন কাশি বা হাঁচি পান তখন আপনার বাঁকানো কনুই বা টিস্যু দিয়ে আপনার মুখ এবং নাকটি ঢেকে রাখুন। তারপরে অবিলম্বে ব্যবহৃত টিস্যুগুলি নিষ্পত্তি করুন।</p><p><strong>কেন? </strong>ফোঁটা ভাইরাস ছড়ায়। ভাল শ্বাস প্রশ্বাসের হাইজিন অনুসরণ করে আপনি আপনার চারপাশের লোকজনকে যেমন ঠান্ডা, ফ্লু(flu) এবং COVID-19 এর ভাইরাস থেকে রক্ষা করেন।</p><h4>আপনার যদি জ্বর, কাশি এবং শ্বাস নিতে সমস্যা হয় তবে তাড়াতাড়ি চিকিত্সা যত্ন নিন</h4><p>আপনি অসুস্থ বোধ করলে বাড়িতেই থাকুন। আপনার যদি জ্বর, কাশি এবং শ্বাস নিতে সমস্যা হয় তবে চিকিত্সার পরামর্শ নিন এবং আগে থেকেই কল করুন। আপনার স্থানীয় স্বাস্থ্য কর্তৃপক্ষের নির্দেশাবলী অনুসরণ করুন।</p><p><strong>কেন? </strong>জাতীয় ও স্থানীয় কর্তৃপক্ষের কাছে আপনার অঞ্চলের পরিস্থিতি সম্পর্কে সর্বাধিক যুগোপযোগী তথ্য থাকবে। আগে থেকে কল করা আপনার স্বাস্থ্যসেবা সরবরাহকারীকে দ্রুত আপনাকে সঠিক স্বাস্থ্য সুবিধার দিকে পরিচালিত করার অনুমতি দেবে। এটি আপনাকে রক্ষা করবে এবং ভাইরাস এবং অন্যান্য সংক্রমণের বিস্তার রোধ করতে সহায়তা করবে।</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FqF42gZVm1Bo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DqF42gZVm1Bo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FqF42gZVm1Bo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/88ebd3c5cba7e9e445e3a7f8e4f985bb/href">https://medium.com/media/88ebd3c5cba7e9e445e3a7f8e4f985bb/href</a></iframe><h4>অবহিত থাকুন এবং আপনার স্বাস্থ্যসেবা সরবরাহকারীর দেওয়া পরামর্শ অনুসরণ করুন</h4><p>COVID-19 সম্পর্কে সর্বশেষতম বিকাশ সম্পর্কে অবহিত থাকুন। কীভাবে নিজেকে এবং অন্যদের COVID-19 থেকে রক্ষা করবেন সে সম্পর্কে আপনার স্বাস্থ্যসেবা সরবরাহকারী, আপনার জাতীয় এবং স্থানীয় জনস্বাস্থ্য কর্তৃপক্ষ বা আপনার নিয়োগকর্তার দেওয়া পরামর্শ অনুসরণ করুন।</p><p><strong>কেন? </strong>জাতীয় ও স্থানীয় কর্তৃপক্ষের কাছে আপনার অঞ্চলে সিভিডি -১৯ ছড়িয়ে পড়ছে কিনা সে সম্পর্কে সর্বাধিক যুগোপযোগী তথ্য থাকবে। আপনার অঞ্চলের লোকেরা তাদের সুরক্ষার জন্য কী করা উচিত সে বিষয়ে পরামর্শ দেওয়ার জন্য এগুলি সর্বোত্তমভাবে স্থাপন করা হয়েছে।</p><h4>যেসব ব্যক্তি COVID-19 ছড়িয়ে পড়ছে সেখানে সম্প্রতি বা গত ১৪ দিন পরিদর্শন করেছেন এমন ব্যক্তিদের সুরক্ষা ব্যবস্থা</h4><ul><li>উপরে বর্ণিত গাইডেন্স অনুসরণ করুন।</li><li>আপনি সুস্থ না হওয়া অবধি যদি আপনি অসুস্থ বোধ শুরু করেন, এমনকি মাথা ব্যথা এবং হালকা নাক দিয়ে নাকের মতো হালকা লক্ষণ রয়েছে। <strong>কেন? </strong>অন্যের সাথে যোগাযোগ এড়ানো এবং চিকিত্সা সুবিধাগুলি পরিদর্শন করা এই সুবিধাগুলি আরও কার্যকরভাবে পরিচালিত করতে এবং আপনাকে এবং অন্যদেরকে সম্ভাব্য COVID-19 এবং অন্যান্য ভাইরাস থেকে রক্ষা করতে সহায়তা করবে।</li><li>যদি আপনার জ্বর, কাশি এবং শ্বাসকষ্ট হয় তবে অবিলম্বে চিকিত্সার পরামর্শ নিন কারণ এটি শ্বাস প্রশ্বাসের সংক্রমণ বা অন্যান্য গুরুতর অবস্থার কারণে হতে পারে। আগে থেকেই কল করুন এবং আপনার সরবরাহকারীর সাথে সাম্প্রতিক যাতায়াত বা যাত্রীদের সাথে যোগাযোগের কথা বলুন। <strong>কেন? </strong>আগে থেকে কল করা আপনার স্বাস্থ্যসেবা সরবরাহকারীকে দ্রুত আপনাকে সঠিক স্বাস্থ্য সুবিধার দিকে পরিচালিত করার অনুমতি দেবে। এটি COVID-19 এবং অন্যান্য ভাইরাসগুলির সম্ভাব্য বিস্তার রোধ করতেও সহায়তা করবে।</li></ul><p><a href="https://www.who.int/emergencies/diseases/novel-coronavirus-2019/advice-for-public">সংগৃহীত</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cde61a25087" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular RxJS Observable Class]]></title>
            <link>https://medium.com/@bipon68/angular-rxjs-observable-class-d037cc7ce318?source=rss-cd17e88e5eac------2</link>
            <guid isPermaLink="false">https://medium.com/p/d037cc7ce318</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[observables]]></category>
            <dc:creator><![CDATA[Bipon Biswas]]></dc:creator>
            <pubDate>Tue, 17 Mar 2020 15:01:06 GMT</pubDate>
            <atom:updated>2020-03-18T07:10:04.226Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pMX6xWZZY7O8ydHofGnvRg.png" /><figcaption>Angular RxJS Observable Class</figcaption></figure><p><strong>Objective</strong>: In this article, you will use the HTTP library in Angular in conjunction with RxJS, HTTP GET request, RxJS Observables to handle an asynchronous web API request.</p><p><strong>Pre-requisite</strong> Prior to completing this article, you should have already installed all pre-requisite tooling including: Visual Studio Code, Node Package Manager (NPM), Node, Angular CLI.</p><h4>Setup✨</h4><ol><li>On your local machine, open <strong>Visual Studio Code</strong>.</li><li>Go to the <strong>File</strong> menu and select the <strong>Open Folder</strong> option.</li><li>Create a new project for this exercise and <em>select</em> this folder.</li><li>Create a new project: open terminal by <strong>Ctrl + backtic(`)</strong> key then run <strong>ng new angular-medium </strong>command</li></ol><h4>Bootstrapping Your Environment✌</h4><ol><li>In Visual Studio Code, <strong>Ctrl + backtic(`)</strong> key press and select the <strong>Open in Terminal</strong> option.</li><li>Run the <strong>angular-medium project </strong>using npm:</li></ol><pre>npm start</pre><p>To start the port correctly in your desired port use:</p><pre>npm start --port 8000 --open</pre><h4>Add the Http Module</h4><ol><li>Within the <strong>app</strong> folder, open the <strong>app.module.ts</strong> file.</li><li>Add an import statement to the top of your file that imports the <strong>HttpClientModule</strong> module from the <strong>@angular/common/http</strong> package:</li></ol><pre>import {HttpClientModule} from &#39;@angular/common/http&#39;;</pre><p>3. Update the <strong>NgModule</strong> decorator by adding the <strong>HttpClientModule</strong> module to the values in the <strong>import</strong> array property of the <strong>NgModule</strong> decorator:</p><pre>@NgModule({<br>    imports:      [ <br>        BrowserModule,<br>        HttpClientModule<br>    ],<br>    declarations: [ <br>        AppComponent<br>    ],<br>    bootstrap: [ AppComponent ]<br>})<br>export class AppModule { }</pre><h4>Invoke HTTP Get Method</h4><ol><li>Within the <strong>app</strong> folder, open the <strong>app.component.ts</strong> file.</li><li>Add a new <strong>import</strong> statement to import the <strong>HttpClient</strong> from the <strong>@angular/common/http </strong>library module:</li></ol><pre>import { HttpClient } from &#39;@angular/common/http&#39;;</pre><p>3. Add a new <strong>import</strong> statement to import the <strong>Observable</strong> member (class) from the <strong>rxjs</strong> library module:</p><pre>import {Observable} from &#39;rxjs&#39;;</pre><p>4. Within the <strong>AppComponent</strong> class, add a new property named <strong>dataItems</strong> of type <strong>string</strong>:</p><pre>export class AppComponent {<br>    dataItems2:ItemList[]=[];<br>}</pre><p>5. Within the <strong>AppComponent</strong> class, add a new empty constructor:</p><pre>export class AppComponent {<br>    dataItems2:ItemList[]=[];<br>    constructor() {<br>    }<br>}</pre><p>6. Add a model named <strong>ItemList. </strong>And import into <strong>app.component.ts </strong>file</p><pre>import { ItemList } from &#39;./model&#39;;</pre><pre>export class ItemList{<br>    public userId: number;<br>    public id: number;<br>    public title: string<br>}</pre><p>7. Update the constructor by adding a parameter of type <strong>httpclient</strong>:</p><pre>constructor(private httpclient : HttpClient) {<br>}</pre><p>8. Within the <strong>AppComponent</strong> class, add a new method named <strong>getDummyApiData2</strong>:</p><pre>export class AppComponent {<br>    dataItems2:ItemList[]=[];<br>    constructor(private httpclient : HttpClient) { ... }<br>    private getDummyApiData2() {<br>    }<br>}</pre><p>9. Update the <strong>getDummyApiData2 </strong>method signature by adding return type of <strong>Observable&lt;Response&gt;</strong>:</p><pre>private getDummyApiData2() : Observable&lt;ItemList[]&gt; {<br>}</pre><p>10. Within the <strong>getDummyApiData2 </strong>method, return the result of invoking the <strong>get</strong> method on the <strong>httpclient</strong> private variable:</p><ul><li><a href="https://jsonplaceholder.typicode.com/posts">https://jsonplaceholder.typicode.com/posts</a></li></ul><pre>private getbiponIPAddress() : Observable&lt;ItemList[]&gt; {<br>    return this.httpclient.get&lt;ItemList[]&gt;(&#39;https://jsonplaceholder.typicode.com/posts&#39;);<br>}</pre><p>11. Returning to the empty constructor, add a line of code to invoke the <strong>getDummyApiData2 </strong>method:</p><pre>constructor(private httpclient : HttpClient) {<br>    this.getDummyApiData2()<br>}</pre><p>12. Subscribe to the data being available by invoking the subscribe method:</p><pre>constructor(private httpclient : HttpClient) {<br>    this.getDummyApiData2()<br>      .subscribe(res =&gt; {<br>         this.dataItems2 = res;<br>    });<br>}</pre><p>13. Update the subscribe method by adding an inline anonymous function to get the result of the IP Address request and save it to the <strong>dataItems2</strong> property in the <strong>AppComponent</strong> class:</p><pre>constructor(private httpclient : HttpClient) {<br>    this.getDummyApiData2()<br>      .subscribe(res =&gt; {<br>         this.dataItems2 = res;<br>    });<br>}</pre><p>14. Your final <strong>app.component.ts</strong> class should now look like this:👀</p><pre>import {Component} from &#39;<a href="http://twitter.com/angular/core">@angular/core</a>&#39;;<br>import { HttpClient } from &#39;<a href="http://twitter.com/angular/common">@angular/common</a>/http&#39;;<br>import {Observable} from &#39;rxjs&#39;;</pre><pre><a href="http://twitter.com/Component">@Component</a>({<br>    selector: &#39;app&#39;,<br>    templateUrl: &#39;./app.component.html&#39;,<br>    styleUrls: &#39;./app.component.css&#39;,<br>})<br>export class AppComponent {<br>    dataItems2:ItemList[]=[];</pre><pre>constructor(private httpclient : HttpClient) {<br>    this.getDummyApiData2()<br>      .subscribe(res =&gt; {<br>         this.dataItems2 = res;<br>    });<br>  }<br>    private getDummyApiData2() : Observable&lt;ItemList[]&gt; {<br>     return this.httpclient.get&lt;ItemList[]&gt;(&#39;<a href="https://jsonplaceholder.typicode.com/posts&#39;">https://jsonplaceholder.typicode.com/posts&#39;</a>);<br>    }<br>}</pre><p><strong>###Another way 🎁</strong></p><p>Just restructure for smarter way to data access.</p><p><strong>app.component.ts</strong></p><pre>import { SampleService } from &#39;./sample.service&#39;;</pre><pre>dataItems:ItemList[]=[];</pre><pre>constructor(<br>      private sampleService:SampleService, <br>      private httpclient: HttpClient) {  <br>        this.getDummyApiData();<br>    }</pre><pre>private getDummyApiData(){<br>      this.sampleService.getDataList().subscribe(data=&gt;{<br>      this.dataItems=data;<br>})</pre><p><strong>sample.service.ts</strong> file</p><pre>getDataList():Observable&lt;ItemList[]&gt;{<br>    return this.http.get&lt;ItemList[](&#39;<a href="https://jsonplaceholder.typicode.com/posts&#39;">https://jsonplaceholder.typicode.com/posts&#39;</a>);<br>  }</pre><p><strong>app.component.html</strong> file</p><pre>&lt;ul&gt;<br>    &lt;li *ngFor=&quot;let item of dataItems&quot;&gt;<br>        {{item.title}}<br>    &lt;/li&gt; <br>&lt;/ul&gt;</pre><h4>Render HTTP Response👏</h4><ol><li>Within the <strong>app</strong> folder, open the <strong>app.component.html</strong> file.</li><li>Render the value of the <strong>dataItems2 </strong>property iterate by adding *ngFor directive and a template expression:</li></ol><pre>&lt;h1&gt;Dummy App&lt;/h1&gt;<br>&lt;strong&gt; <strong>Example List Item:</strong>:&lt;/strong&gt;<br>&lt;ul&gt;<br>    &lt;li *ngFor=&quot;let item of dataItems2&quot;&gt;<br>        {{item.title}}<br>    &lt;/li&gt; <br>&lt;/ul&gt;</pre><p><strong>Output</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*_FusmFNjOlyJ-2rY6ru8cg.png" /></figure><p><a href="https://github.com/bipon68/angular-medium"><strong>Github URL</strong></a></p><p><a href="https://stackblitz.com/github/bipon68/angular-medium"><strong>StackBlitz URL</strong></a></p><p><strong>Reference</strong></p><p><a href="https://jsonplaceholder.typicode.com/">Fake Online REST API for Testing and Prototyping</a></p><p><a href="https://scrimba.com/g/gintrototypescript">TypeScript</a></p><p><a href="https://stackoverflow.com/">Stack Overflow</a></p><p><a href="https://angular.io/cli">Angular CLI</a></p><p><a href="https://medium.com/javascript-in-plain-english/the-right-way-to-make-api-calls-in-angular-5cc03a62bf43">Right way to make API calls</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d037cc7ce318" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular HTTP Client Library]]></title>
            <link>https://medium.com/@bipon68/angular-http-client-library-4a305d99e4af?source=rss-cd17e88e5eac------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a305d99e4af</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[http-client]]></category>
            <dc:creator><![CDATA[Bipon Biswas]]></dc:creator>
            <pubDate>Sun, 15 Mar 2020 16:56:10 GMT</pubDate>
            <atom:updated>2020-03-15T18:29:24.783Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWaKuqzUEwfjnJrZj4oZVw.jpeg" /></figure><p><strong>Objective</strong>: In this article, you will use the HTTP library in Angular , HTTP GET request, web API request.</p><p><strong>Pre-requisite</strong> Prior to completing this article, you should have already installed all pre-requisite tooling including: Visual Studio Code, Node Package Manager (NPM), Node, Angular CLI.</p><h4>Setup✨</h4><ol><li>On your local machine, open <strong>Visual Studio Code</strong>.</li><li>Go to the <strong>File</strong> menu and select the <strong>Open Folder</strong> option.</li><li>Create a new project for this exercise and <em>select</em> this folder.</li><li>Create a new project: open terminal by <strong>Ctrl + backtic(`)</strong> key then run <strong>ng new angular-medium </strong>command</li></ol><h4>Bootstrapping Your Environment✌</h4><ol><li>In Visual Studio Code, <strong>Ctrl + backtic(`)</strong> key press and select the <strong>Open in Terminal</strong> option.</li><li>Run the <strong>angular-medium project </strong>using npm:</li></ol><pre>npm start</pre><p>To start the port correctly in your desired port use:</p><pre>npm start --port 8000 --open</pre><h4>Add the Http Module</h4><ol><li>Within the <strong>app</strong> folder, open the <strong>app.module.ts</strong> file.</li><li>Add an import statement to the top of your file that imports the <strong>HttpModule</strong> module from the <strong>@angular/http</strong> package:</li></ol><pre>import {HttpModule} from &#39;@angular/http&#39;;</pre><p>3. Update the <strong>NgModule</strong> decorator by adding the <strong>HttpModule</strong> module to the values in the <strong>import</strong> array property of the <strong>NgModule</strong> decorator:</p><pre>@NgModule({<br>    imports:      [ <br>        BrowserModule,<br>        HttpModule<br>    ],<br>    declarations: [ <br>        AppComponent<br>    ],<br>    bootstrap: [ AppComponent ]<br>})<br>export class AppModule { }</pre><p><strong>Note: </strong>if run this project then can’t run this project. Get this error: <a href="https://stackoverflow.com/questions/38510369/cannot-find-module-angular-http">cannot find module ‘@angular/http’?</a></p><p><strong>#run this in terminal:👍</strong></p><pre>npm install @angular/http@latest</pre><h4>Invoke HTTP Get Method</h4><ol><li>Within the <strong>app</strong> folder, open the <strong>app.component.ts</strong> file.</li><li>Add a new <strong>import</strong> statement to import the <strong>Http</strong> and <strong>Response</strong> members (classes) from the <strong>@angular/http</strong> library module:</li></ol><pre>import {Http, Response} from &#39;@angular/http&#39;;</pre><p>3. Within the <strong>AppComponent</strong> class, add a new property named <strong>dataItems </strong>of type <strong>array</strong>:</p><pre>export class AppComponent {<br>    public dataItems : ItemList[]=[];<br>}</pre><p>4. Create a model named <strong>model.ts</strong></p><pre>export class ItemList{<br>    public userId: number;<br>    public id: number;<br>    public title: string<br>}</pre><p>5. Within the <strong>AppComponent </strong>import model <strong>model.ts</strong></p><pre>import { ItemList } from &#39;./model&#39;;</pre><p>6. Within the <strong>AppComponent</strong> class, add a constructor with a single parameter named <strong>http</strong> of type <strong>Http</strong>:</p><pre>export class AppComponent {<br>    public dataItems : ItemList[]=[];<br>    constructor(private http : Http) {<br>    }<br>}</pre><p>7. Add <strong>getDummyApiData</strong> method into constructor:</p><pre>constructor(private http : Http) {<br>    this.getDummyApiData();<br>}</pre><p>8. Add <strong>getDummyApiData </strong>method outside constructor. Also chain an invocation of the <strong>toPromise</strong> method:</p><pre>private getDummyApiData(){<br>      this.http.get(&#39;<a href="https://jsonplaceholder.typicode.com/posts&#39;">https://jsonplaceholder.typicode.com/posts&#39;</a>)<br>        .toPromise()<br>    }</pre><p>9. Add a handler for a successful promise by chaining an invocation of the <strong>then</strong> method:</p><pre>private getDummyApiData(){<br>      this.http.get(&#39;<a href="https://jsonplaceholder.typicode.com/posts&#39;">https://jsonplaceholder.typicode.com/posts&#39;</a>)<br>        .toPromise()<br>        .then()<br>    }</pre><p>10. Within the <strong>then</strong> method, invoke the <strong>json</strong> method of the <strong>response</strong> object and store the value of it’s <strong>dataItems</strong> you created earlier:</p><pre>private getDummyApiData(){<br>      this.http.get(&#39;<a href="https://jsonplaceholder.typicode.com/posts&#39;">https://jsonplaceholder.typicode.com/posts&#39;</a>)<br>        .toPromise()<br>        .then(response =&gt; {<br>          this.dataItems = response.json();<br>          console.log(this.dataItems)<br>        })<br>    }</pre><p>11. Add a handler for a unsuccessful promise by chaining an invocation of the <strong>catch</strong> method and adding a semi-colon to complete the statement:</p><pre>private getDummyApiData(){<br>      this.http.get(&#39;<a href="https://jsonplaceholder.typicode.com/posts&#39;">https://jsonplaceholder.typicode.com/posts&#39;</a>)<br>        .toPromise()<br>        .then(response =&gt; {<br>          this.dataItems = response.json();<br>          console.log(this.dataItems)<br>        })<br>        .<strong>catch</strong>(error =&gt; console.log(error))<br>    }</pre><p>12. Your final <strong>app.component.ts</strong> class should now look like this:👀</p><pre>import {Component} from &#39;@angular/core&#39;;<br>import {Http, Response} from &#39;@angular/http&#39;;<br>import { ItemList } from &#39;./model&#39;;</pre><pre>@Component({<br>    selector: &#39;app&#39;,<br>    templateUrl: &#39;./app.component.html&#39;,<br>    styleUrls: &#39;./app.component.css&#39;,</pre><pre>})<br>export class AppComponent {<br>    dataItems:ItemList[]=[];</pre><pre>   constructor(private http: Http) {  <br>      this.getDummyApiData();<br>    }</pre><pre>private getDummyApiData(){<br>      this.http.get(&#39;<a href="https://jsonplaceholder.typicode.com/posts&#39;">https://jsonplaceholder.typicode.com/posts&#39;</a>)<br>        .toPromise()<br>        .then(response =&gt; {<br>          this.dataItems = response.json();<br>          console.log(this.dataItems)<br>        })<br>        .<strong>catch</strong>(error =&gt; console.log(error))<br>    }<br>}</pre><h4>Render HTTP Response</h4><ol><li>Within the <strong>app/views</strong> folder, open the <strong>app.component.html</strong> file.</li><li>Render the value of the <strong>dataItems</strong> array type property of the component class by iterate a template expression:</li></ol><pre>&lt;h1&gt;Demo App&lt;/h1&gt;<br>&lt;hr /&gt;<br>&lt;strong&gt;Example List Item:&lt;/strong&gt;<br>&lt;ul&gt;<br>    &lt;li *ngFor=&quot;let item of dataItems&quot;&gt;<br>        {{item.title}}<br>    &lt;/li&gt; <br>&lt;/ul&gt;</pre><p><strong>Output</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*_FusmFNjOlyJ-2rY6ru8cg.png" /></figure><p><a href="https://stackblitz.com/github/bipon68/angular-medium">Demo URL</a></p><p><a href="https://github.com/bipon68/angular-medium">Github URL</a></p><p><strong>Reference</strong></p><p><a href="https://jsonplaceholder.typicode.com/">Fake Online REST API for Testing and Prototyping</a></p><p><a href="https://scrimba.com/g/gintrototypescript">TypeScript</a></p><p><a href="https://angular.io/cli">Angular CLI</a></p><p><a href="https://stackoverflow.com/">Stack Overflow</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a305d99e4af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular Built-In Directives]]></title>
            <link>https://medium.com/@bipon68/angular-built-in-directives-f2a4601faac6?source=rss-cd17e88e5eac------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2a4601faac6</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[directives]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Bipon Biswas]]></dc:creator>
            <pubDate>Tue, 10 Mar 2020 19:03:35 GMT</pubDate>
            <atom:updated>2020-03-13T05:29:57.335Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y3iE8ovdDMda9zg7qwl5LA.jpeg" /><figcaption>Angular Built-In Directives</figcaption></figure><p><strong>Objective</strong>: In this article, you will use the built-in directives in Angular to change the appearance of your view.</p><p><strong>Pre-requisite</strong> Prior to completing this article, you should have already installed all pre-requisite tooling including: Visual Studio Code, Node Package Manager (NPM), Node, Angular CLI.</p><h3>Setup</h3><ol><li>On your local machine, open <strong>Visual Studio Code</strong>.</li><li>Go to the <strong>File</strong> menu and select the <strong>Open Folder</strong> option.</li><li>Create a new project for this exercise and <em>select</em> this folder.</li><li>Create a new project command: <strong>ng new angular-medium</strong></li><li>Create a new project: open terminal by <strong>Ctrl + backtic(`)</strong> key then run <strong>ng new angular-medium </strong>command</li></ol><h4>Bootstrapping Your Environment</h4><ol><li>In Visual Studio Code, <strong>Ctrl + backtic(`)</strong> key press and select the <strong>Open in Terminal</strong> option.</li><li>Run the <strong>angular-medium project </strong>using npm:</li></ol><pre>npm start</pre><p>Now you can see the project from here. This is default url.</p><pre><a href="http://localhost:4200/">http://localhost:4200/</a></pre><p>To start the port correctly in your desired port use:</p><pre>npm start --port 8000 --open</pre><h4>Add Properties to the AppComponent Class</h4><ol><li>Within the <strong>app</strong> folder, open the <strong>app.component.ts</strong> file.</li><li>Within the <strong>AppComponent</strong> class, add a new property of type <strong>boolean</strong> named <strong>showPanel</strong> with a value of <strong>true:</strong></li></ol><pre>export class AppComponent {<br>    public showPanel : boolean = true;<br>}</pre><p>3. Within the <strong>AppComponent</strong> class, add a new method named <strong>getStyles</strong>:</p><pre>export class AppComponent {<br>    public showPanel : boolean = true;<br>    public getStyles() {<br><br>    }         <br>}</pre><p>4. Update the <strong>getStyles</strong> method to return a JSON object with the following properties and values:</p><ul><li><strong>font-weight:</strong> bold</li><li><strong>font-style:</strong> italic</li></ul><pre>export class AppComponent {<br>    public showPanel : boolean = true;<br>    public getStyles() {<br>      return {<br>          &#39;font-style&#39;: &#39;italic&#39;,<br>          &#39;font-weight&#39;: &#39;bold&#39;<br>      }<br>    }         <br>}</pre><p>5. Within the <strong>AppComponent</strong> class, add a new method named <strong>getClasses</strong>:</p><pre>export class AppComponent {<br>    public showPanel : boolean = true;<br>    public getStyles() {<br>      return {<br>          &#39;font-style&#39;: &#39;italic&#39;,<br>          &#39;font-weight&#39;: &#39;bold&#39;<br>      }<br>    }  <br>    public getClasses() {<br><br>    }         <br>}</pre><p>6. Update the <strong>getClasses</strong> method to return a JSON object with the following properties and values:</p><ul><li><strong>highlight:</strong> true</li><li><strong>strike:</strong> false</li></ul><pre>export class AppComponent {<br>    public showPanel : boolean = true;<br>    public getStyles() {<br>      return {<br>          &#39;font-style&#39;: &#39;italic&#39;,<br>          &#39;font-weight&#39;: &#39;bold&#39;<br>      }<br>    }  <br>    public getClasses() {<br>      return {<br>          &#39;highlight&#39;: true,<br>          &#39;strike&#39;: false<br>      }<br>    }         <br>}</pre><h4>Create the CSS Styles</h4><ol><li>Within the <strong>app/views</strong> folder, open the <strong>app.component.html </strong>file.</li><li>Within the <strong>style</strong> element, add a CSS class named <strong>highlight</strong> that sets the <em>background-color</em> to <em>yellow and also more into </em><strong>app.component.css file</strong></li></ol><pre>.highlight {<br>    background-color: yellow;<br>}<br>.text-green {<br>    color: green;<br>}<br>.text-red {<br>    color: red;<br>}<br>.bold{<br>    font-weight: 700;<br>}<br>.strike {<br>    text-decoration: line-through;<br>}</pre><p>3. Within the <strong>p</strong> element, create a new <strong>label</strong> element with the <strong>for</strong> attribute set to <strong>showPanelCheck</strong> and the content <em>Show Panel?</em>:</p><pre>&lt;p&gt;<br>    &lt;label for=&quot;showPanelCheck&quot;&gt;Show Panel?&lt;/label&gt;<br>&lt;/p&gt;</pre><p>4. Within the <strong>p</strong> element, create a new <strong>input</strong> element with the <strong>id</strong> set to <strong>showPanelCheck</strong> and type set to <strong>checkbox</strong>:</p><pre>&lt;p&gt;<br>    &lt;label for=&quot;showPanelCheck&quot;&gt;Show Panel?&lt;/label&gt;<br>    &lt;input id=&quot;showPanelCheck&quot; type=&quot;checkbox&quot; /&gt;<br>&lt;/p&gt;</pre><p>5. Update the <strong>input</strong> element by setting it’s model to the <strong>showPanel</strong> property of the component class:</p><pre>&lt;p&gt;<br>    &lt;label for=&quot;showPanelCheck&quot;&gt;Show Panel?&lt;/label&gt;<br>    &lt;input id=&quot;showPanelCheck&quot; type=&quot;checkbox&quot; [(ngModel)]=&quot;showPanel&quot; /&gt;<br>&lt;/p&gt;</pre><p>6. Create a new <strong>p</strong> element with the content <em>Panel is Shown. </em>Update the <strong>p</strong> element by using the <strong>ngIf</strong> directive and binding it to the <strong>showPanel</strong> property of the component class:</p><pre>&lt;p *ngIf=&quot;showPanel&quot;&gt;<br>   Dummy Panel is Shown<br>&lt;/p&gt;</pre><p>7. Create a new <strong>p</strong> element with the content <em>Custom Classes. </em>Update the <strong>p</strong> element by using the <strong>ngClass</strong> directive and binding it to the <strong>getClasses</strong> method of the component class:</p><pre>&lt;p [ngClass]=&quot;getClasses()&quot;&gt;<br>    Dummy Custom Classes<br>&lt;/p&gt;</pre><p>8. Create a new <strong>p</strong> element with the content <em>Panel is Shown. </em>Update the <strong>p</strong> element by using the <strong>ngStyle</strong> directive and binding it to the <strong>getStyles</strong> property of the component class:</p><pre>&lt;p [ngStyle]=&quot;getStyles()&quot;&gt;<br>    Dummy Custom Styles<br>&lt;/p&gt;</pre><p>9. Sometimes few flag come from backend then using this bellow way</p><p><strong>Another Example</strong></p><pre>&lt;div [ngClass]=&quot;clinicStatusClass()&quot;&gt;<br>    Emergency<br>&lt;/div&gt;<br>&lt;div [ngStyle]=&quot;patientInfoStyle()&quot;&gt;<br>    Patient Allergy<br>&lt;/div&gt;</pre><p><strong>app.component.ts</strong></p><pre>clinicStatusClass() {</pre><pre>  if (this.patientConsultation.ClinicTypeText !== &#39;Emergency&#39;) {</pre><pre>    return [&#39;text-green&#39;, &#39;bold&#39;]</pre><pre>  } else if (this.patientConsultation.ClinicTypeText === &#39;Emergency&#39;) {</pre><pre>    return [&#39;text-red&#39;, &#39;bold&#39;]</pre><pre>}</pre><pre>return []</pre><pre>}</pre><pre>patientInfoStyle(): any {<br>  return { display: &#39;block&#39;, margin: &#39;0 7px&#39;, &#39;min-height&#39;: &#39;215px&#39;, width: &#39;100%&#39; }<br> }</pre><h4>Output:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*vOHDAjuhLjQHvNMrH6PeHw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2a4601faac6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular Template Syntax]]></title>
            <link>https://medium.com/@bipon68/angular-template-syntax-bd54e4bcb035?source=rss-cd17e88e5eac------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd54e4bcb035</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Bipon Biswas]]></dc:creator>
            <pubDate>Mon, 09 Mar 2020 19:33:22 GMT</pubDate>
            <atom:updated>2020-03-13T12:55:40.773Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*om930d56Uaq8yhHTGpGqgA.png" /><figcaption>Angular Template Syntax</figcaption></figure><p><strong>Objective</strong>: In this article, you will use the Angular template syntax to bind view content to properties of your component class.</p><p><strong>Pre-requisite</strong> Prior to completing this article, you should have already installed all pre-requisite tooling including: Visual Studio Code, Node Package Manager (NPM), Node, Angular CLI.</p><h4>Setup</h4><ol><li>On your local machine, open <strong>Visual Studio Code</strong>.</li><li>Go to the <strong>File</strong> menu and select the <strong>Open Folder</strong> option.</li><li>Create a new project for this exercise and <em>select</em> this folder.</li><li>Create a new project command: <strong>ng new angular-medium</strong></li><li>Create a new project: open terminal by Ctrl + backtic(`) key then run <strong>ng new angular-medium </strong>command</li></ol><h4>Add Properties to the AppComponent Class</h4><ol><li>Within the <strong>app</strong> folder, open the <strong>app.component.ts</strong> file.</li><li>Within the <strong>AppComponent</strong> class, add a new property of type <strong>number</strong> named <strong>count</strong> with a value of <strong>2</strong>:</li></ol><pre>export class AppComponent {<br>    public count : number = 2;<br>}</pre><p>3. Within the <strong>AppComponent</strong> class, add a new property of type <strong>boolean</strong> named <strong>indicator</strong> with a value of <strong>true</strong>:</p><pre>export class AppComponent {<br>    public count : number = 2;<br>    public indicator : boolean = true;<br>}</pre><p>4. Within the <strong>AppComponent</strong> class, add a new property of type <strong>string[]</strong> named <strong>nameList</strong> with the following values:</p><ul><li>Bipon</li><li>Arif</li><li>Mahfuz</li></ul><pre>export class AppComponent {<br>    public count : number = 2;<br>    public indicator : boolean = true;<br>    public nameList : string[] = [&#39;Bipon&#39;, &#39;Arif&#39;, &#39;Mahfuz&#39;];<br>}</pre><p>5. Within the <strong>AppComponent</strong> class, add a new property of type <strong>string</strong> named <strong>title</strong> with a value of <strong>Template Binding</strong>:</p><pre>export class AppComponent {<br>    public count : number = 2;<br>    public indicator : boolean = true;<br>    public nameList: string[] = [&#39;Bipon&#39;, &#39;Arif&#39;, &#39;Mahfuz&#39;];<br>    public title : string = &#39;Template Binding&#39;;<br>}</pre><h4>Add the Forms Module</h4><ol><li>Within the <strong>app</strong> folder, open the <strong>app.module.ts</strong> file.</li><li>Add an import statement to the top of your file that imports the <strong>FormsModule</strong> module from the <strong>@angular/forms</strong> package:</li></ol><pre>import {FormsModule} from &#39;@angular/forms&#39;;</pre><p>3. Update the <strong>NgModule</strong> decorator by adding the <strong>FormsModule</strong> module to the values in the <strong>import</strong> array property of the <strong>NgModule</strong> decorator:</p><pre>@NgModule({<br>    imports:      [ <br>        BrowserModule,<br>        FormsModule<br>    ],<br>    declarations: [ <br>        AppComponent<br>    ],<br>    bootstrap: [ AppComponent ]<br>})<br>export class AppModule { }</pre><h4>Use the Angular Template Syntax</h4><ol><li>Within the <strong>app/views</strong> folder, open the <strong>app.component.html</strong> file.</li><li>Delete the existing HTML content.</li><li>Add a new h2 element to the HTML content:</li></ol><pre>&lt;h2&gt;&lt;/h2&gt;</pre><p>4. Within the h2 element, add a binding to the <strong>title</strong> property of the component class:</p><pre>&lt;h2&gt;{{title}}&lt;/h2&gt;</pre><p>5. Add a new <strong>form</strong> element to the HTML content:</p><pre>&lt;h2&gt;{{title}}&lt;/h2&gt;<br>&lt;form&gt;<br>&lt;/form&gt;</pre><p>6. Within the <strong>form</strong> element, add a new <strong>fieldset</strong> element:</p><pre>&lt;form&gt;<br>    &lt;fieldset&gt;<br>    &lt;/fieldset&gt;<br>&lt;/form&gt;</pre><p>7. Within the <strong>fieldset</strong> element, add a new <strong>legend</strong> element with the content <strong>Indicator</strong>:</p><pre>&lt;fieldset&gt;<br>    &lt;legend&gt;Indicator&lt;/legend&gt;<br>&lt;/fieldset&gt;</pre><p>8. Within the <strong>fieldset</strong> element, add a new <strong>input</strong> element with the type <strong>checkbox</strong>:</p><pre>&lt;fieldset&gt;<br>    &lt;legend&gt;Indicator&lt;/legend&gt;<br>    &lt;input type=&quot;checkbox&quot; /&gt;<br>&lt;/fieldset&gt;</pre><p>9. Update the <strong>checkbox</strong> input element to bind it’s model to the <strong>indicator</strong> property:</p><pre>&lt;input type=&quot;checkbox&quot; [(ngModel)]=&quot;indicator&quot; /&gt;</pre><p>10. Within the <strong>form</strong> element, add another new <strong>fieldset</strong> element:</p><pre>&lt;fieldset&gt;<br>        &lt;legend&gt;Count&lt;/legend&gt;<br>        &lt;input type=&quot;range&quot; min=&quot;0&quot; max=&quot;5&quot; step=&quot;1&quot; [(ngModel)]=&quot;count&quot; /&gt;<br>    &lt;/fieldset&gt;</pre><p>11. Within the <strong>ol</strong> element, add a <strong>li</strong> element:</p><pre>&lt;fieldset&gt;<br>    &lt;legend&gt;Messages&lt;/legend&gt;<br>    &lt;ol&gt;<br>          &lt;li&gt;<br>          &lt;/li&gt;<br>    &lt;/ol&gt;<br>&lt;/fieldset&gt;</pre><p>12. Update the <strong>li</strong> element to use the <strong>ngFor</strong> looping syntax to create a for loop over the <strong>nameList</strong> property using a <strong>name </strong>variable for each item:</p><pre>&lt;li *ngFor=&quot;let name of nameList&quot;&gt;<br>&lt;/li&gt;</pre><p>13. Update the content of the <strong>li</strong> element by binding it to the <strong>name</strong> variable within the loop:</p><pre>&lt;li *ngFor=&quot;let name of nameList&quot;&gt;<br>    {{name}}<br>&lt;/li&gt;</pre><p>14. Also added few <strong>fieldset</strong> element. Finally your HTML content in <strong>app.component.html</strong> should now look like this:</p><pre>&lt;h2&gt;{{title}}&lt;/h2&gt;<br>&lt;form&gt;<br>    &lt;fieldset&gt;<br>        &lt;legend&gt;Indicator&lt;/legend&gt;<br>        &lt;input type=&quot;checkbox&quot; [(ngModel)]=&quot;indicator&quot; /&gt;<br>    &lt;/fieldset&gt;<br>    &lt;fieldset&gt;<br>        &lt;legend&gt;Count&lt;/legend&gt;<br>        &lt;input type=&quot;range&quot; min=&quot;0&quot; max=&quot;5&quot; step=&quot;1&quot; [(ngModel)]=&quot;count&quot; /&gt;<br>    &lt;/fieldset&gt;<br>    &lt;fieldset&gt;<br>        &lt;legend&gt;Name List&lt;/legend&gt;<br>        &lt;ol&gt;<br>            &lt;li *ngFor=&quot;let name of nameList&quot;&gt;<br>                {{name}}<br>            &lt;/li&gt;<br>        &lt;/ol&gt;<br>    &lt;/fieldset&gt;<br>    &lt;fieldset&gt;<br>        &lt;legend&gt;Results&lt;/legend&gt;<br>        &lt;ul&gt;<br>            &lt;li&gt;&lt;strong&gt;Indicator:&lt;/strong&gt; {{indicator}}&lt;/li&gt;<br>            &lt;li&gt;&lt;strong&gt;Count:&lt;/strong&gt; {{count}}&lt;/li&gt;<br>            &lt;li&gt;&lt;strong&gt;Title:&lt;/strong&gt; {{title}}&lt;/li&gt;<br>            &lt;li&gt;&lt;strong&gt;Name List:&lt;/strong&gt; {{nameList}}&lt;/li&gt;<br>        &lt;/ul&gt;<br>    &lt;/fieldset&gt;<br>&lt;/form&gt;</pre><p>Output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*B9XRD-_UFfT_VLKqleG2qQ.png" /><figcaption>Angular Template Syntax Example</figcaption></figure><p><strong>Reference</strong></p><p><a href="https://medium.com/angular-in-depth/angular-mastery-template-syntax-194bffe2ad6f">Also more</a></p><p><a href="https://angular.io/guide/template-syntax">Template syntax</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd54e4bcb035" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Front End Developer / Engineer: Anything that wants to be imported …]]></title>
            <link>https://medium.com/@bipon68/front-end-developer-engineer-anything-that-wants-to-be-imported-e3032a984663?source=rss-cd17e88e5eac------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3032a984663</guid>
            <category><![CDATA[engineer]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Bipon Biswas]]></dc:creator>
            <pubDate>Mon, 09 Mar 2020 17:53:10 GMT</pubDate>
            <atom:updated>2020-03-09T17:53:10.354Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*tX73gp-yCBPnprYKapw11A.jpeg" /></figure><h3>Front End Developer / Engineer: Anything that wants to be imported …</h3><p><a href="https://medium.com/@bipon68/front-end-engineer-scope-of-work-and-responsibility-a993230af3df">The previous article</a> highlighted the responsibility of a frontend developer (FE Dev). This post is about the skills that need to be put in place to perform those duties well.</p><p>Since the responsibilities are many, the list of know-how is also quite large. Not all specialists need to be experts. Not even possible. But there must be some issues. So let’s get started-</p><h3>Wireframing:</h3><p><a href="https://www.youtube.com/watch?v=i4Zg6_yKOh8">Need</a> to know how to <a href="https://www.youtube.com/watch?v=i4Zg6_yKOh8">wireframing</a> quickly to discuss or get feedback from any new concept or idea colleagues . There are <a href="http://www.creativebloq.com/wireframes/top-wireframing-tools-11121302">many tools / services</a> to do this. In order to increase the acceptance of the concept , you need to be <a href="https://medium.com/@uxhow/ux-design-resource-guide-926676be3e0">familiar</a> with <a href="https://medium.com/@uxhow/ux-design-resource-guide-926676be3e0">Basic UX</a> .</p><h3>Implementation Planning or Implementation Planning:</h3><p>After the new design html and CSS if you do the more <a href="http://getbem.com/">reuse</a> can be done, am in class <a href="http://getbem.com/">conflict</a> can be avoided, and the <a href="https://www.edx.org/course/advanced-css-concepts-microsoft-dev218x">plan</a> should be. While this planning phase may seem like a waste of time at the start of the project, it will save a lot of time on the project life cycle. If you practice planning from the beginning, these skills will continue to grow as the experience grows. This phase is what separates an expert from the average developer.</p><h3>Photoshop/Illustrator/Sketch/Adobe XD:</h3><p>There are several changes in the design of the project life cycle. Some are added, some are minus. Designers may not always be available at hand. Then FE Dev will have to take this responsibility. Photoshop’s basic operations must be occupied. If you want to make HTML from PSD, then you need Photoshop skills. If you have a basic idea about Illustrator, good. For example, my current project design client is Illustrator. Working on a Mac will greatly benefit the basic knowledge of <a href="https://www.sketchapp.com/">sketches</a> .</p><h3>HTML and CSS:</h3><p>It might not even have been mentioned. But there are some things that many of us overlook. For example, the <em>position: absolute</em> or <em>display: inline-block</em> rule does not understand the logic behind the changes, even though you know what changes the browser. As a result of complex design markup, one has to face various problems. The same can be said for html. You need to know the logic behind it. Must be in css display, position, float, animation fingertips. To become a CSS architect you need to have an idea of <a href="https://www.html5rocks.com/en/tutorials/internals/howbrowserswork/">how</a> the <a href="https://www.html5rocks.com/en/tutorials/internals/howbrowserswork/">browser works</a> .</p><h3>CSS Processor:</h3><p>Many people are familiar with <a href="http://lesscss.org/">Less</a> or <a href="https://sass-lang.com/">Sass</a> for their work on <a href="http://getbootstrap.com/">Bootstrap</a> . But in the possession of Market <a href="http://sass-lang.com/">Sass</a> . This is a requirement in most job postings. So the importance of the sauce is still going without spending a word. You need to know about Sass’s <a href="https://www.youtube.com/playlist?list=PL2CB1F80266E986EA">variable, Mixin, placeholder</a> . Recently <a href="https://stylus-lang.com/">stylus</a> is also popular, however, know about it at the moment.</p><h3>Responsiveness and Cross-Browser Compatibility:</h3><p>Responsive and <a href="https://www.sitepoint.com/the-7-cross-browser-testing-tools-you-need-in-2016/">cross browser compatible</a> . <a href="https://speckyboy.com/top-50-css-libraries-frameworks-tools-2016/">Have</a> transparent ideas about the <a href="https://speckyboy.com/top-50-css-libraries-frameworks-tools-2016/">CSS framework</a> , especially bootstrap. Following the perfect testing process, the Cross-Browser Compatibility Skill will continue to grow with experience.</p><h3>Javascript:</h3><p>Frontend is incomplete without JavaScript (JS). <a href="https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f#.o4d0wopo5">Here are some questions</a> . How much to know? Core language or framework? Which framework? Functional programming or object oriented? Etc .. etc….</p><p>FE developers can be mainly <a href="https://css-tricks.com/the-front-end-developers-dilemma/">divided</a> into two categories. CSS Centric and JS Centric. First-party Devora CSS Expert and know as much or as little as JavaScript can do. In the domestic market, their value is relatively low. The skills of the second-party Dave and the demand in the country’s market are exactly the opposite of the first-team.</p><p><a href="https://medium.com/javascript-scene/top-javascript-frameworks-topics-to-learn-in-2017-700a397b711">You</a> need to learn both <a href="https://medium.com/javascript-scene/top-javascript-frameworks-topics-to-learn-in-2017-700a397b711">plain JavaScript and any framework</a> . There is a lot of talk in the <a href="https://www.facebook.com/groups/talkjs.net/">community</a> about React, but AngularJS still wins the country. Although there is an outward criticism of Angular2, if it is stable in 2017 then it will continue to be used at an increasing rate from 2018.</p><h3>Task Runner / Module Bundler:</h3><p>Grunt / Gulp / Webpack If you have any idea about one. You must learn to <a href="https://www.youtube.com/playlist?list=PLLnpHn493BHE2RsdyUNpbiVn-cfuV7Fos">concat and minify</a> source files .</p><h3>Communication skills:</h3><p><a href="http://frontend.turing.io/professional-development/extensions_and_resources/communication_skills">Communication skills are</a> essential for FE Dev because they are the connecting bridge between design and backend. This skill will protect developers from a lot of stress. Regardless of the technical qualifications, the lack of communication will make it difficult to build a successful career.</p><p>In addition to having good control over the above factors, the list can be larger depending on the project. I have to be very addicted to learning something new. Must read the book. On Youtube <a href="https://www.youtube.com/user/jsconfeu">Conference Talk</a> will see.</p><p>There is nothing to be discouraged about. If the leg is just a matter of time. But where do I start learning? Which way to go? What is a roadmap? Roadmap — this will be the topic of the next post.</p><p><em>If you have an opinion or question about the article, comment. If you like please share.</em></p><p><a href="https://bit.ly/2wLhhH6">Original Article</a><br>Author: <strong>Kamal Sharif</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3032a984663" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>