<?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 Dimitar Stoev on Medium]]></title>
        <description><![CDATA[Stories by Dimitar Stoev on Medium]]></description>
        <link>https://medium.com/@dimitarg.stoev?source=rss-f3e9f0377b09------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QH3Sj3Y7FpYxOuikOB1lJA.png</url>
            <title>Stories by Dimitar Stoev on Medium</title>
            <link>https://medium.com/@dimitarg.stoev?source=rss-f3e9f0377b09------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:45:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dimitarg.stoev/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 questions — PART 3]]></title>
            <link>https://medium.com/@dimitarg.stoev/angular-questions-part-3-408712f1d9c6?source=rss-f3e9f0377b09------2</link>
            <guid isPermaLink="false">https://medium.com/p/408712f1d9c6</guid>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[interview-tips]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Dimitar Stoev]]></dc:creator>
            <pubDate>Mon, 14 Aug 2023 19:28:08 GMT</pubDate>
            <atom:updated>2023-08-14T19:28:08.291Z</atom:updated>
            <content:encoded><![CDATA[<h3>Angular questions — PART 3</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KiOYp_1hG-fGh23CkbUTBA.png" /></figure><h3>Getting started</h3><p>This is my personal favorite article on the most Angular interview questions. I am writing about some more “advanced” topics and familiarizing yourself further on that is definitely going to be a game changer!</p><p>Let’s check what we are going to talk about:</p><p>1. What is Hydration</p><p>2. Unit testing</p><p>3. ng-content</p><p>4. What is a singleton in Angular</p><p>5. Design patterns in Angular</p><p>6. Structuring application</p><p>7. Services</p><p>8. Advantages of Angular</p><p>9. What is a MVVM architecture</p><p>10. Angular inbuilt pipes</p><p>11. Change detection</p><p>Let’s start with the first one.</p><h3>What is a Hydration</h3><p>First thing first — it is connected to Server Side Rendering.</p><p>Hydration is the process that restores the server side rendered application on the client.</p><p>One main feature is reusing the server rendered DOM structure, avoiding the extra work to re-create the DOM nodes. Angular tries to match the existing DOM elements at runtime and reuses DOM nodes when possible.</p><p>This is a huge performance booster!</p><p>In order to use it, Angular Universal is needed and it has to be bootstrapped in the following way</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wWbJXiGBthR34QbJ7ExkpA.png" /></figure><p>One thing to keep in mind.</p><p>The HTML produced by the server side rendering, <strong>must not be altered</strong> between the server and the client.</p><p>If mismatch is found, the hydration process will encounter problems attempting to match it up.</p><p>It’s a common problem with manipulating the DOM with native APIs such as innerHTML, appendChild and so on.</p><p>If you need that, you can skip the hydration for the component.</p><p>it is done with <strong>ngSkipHydration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JnUevXyp0nhrBbfIZ-clwg.png" /></figure><p>Another thing to mention is that hydration is dependent on zone.js and currently as of writing this article, there is no way to <strong>noop </strong>zone.js.</p><h3>Unit testing in Angular</h3><p>This is the process of testing isolated pieces of your code. This provides the advantage of catching and preventing bugs in the long term.</p><p>What does Angular use for testing?</p><p>Well, you can use anything and set up anything you like, but by default, Angular uses Jasmine and Karma.</p><p><strong>Jasmine is a behavior driven development framework for testing </strong>JavaScript code.</p><p>It is a very popular and mature framework.</p><p>Karma is the task runner for the tests. It executes the Jasmine code and runs it either in the browser or in a headless browser environment.</p><p>The configuration of Jasmine and Karma is done by the Angular CLI.</p><p>It is a good practice to include testing in the CI!</p><h3>ng-content</h3><p>It is one of the best features of Angular, in my opinion.</p><p>This is a pattern for content projection, in which a content is inserted ( or projected ) inside another component.</p><p>Custom attributes applied to ng-content are ignored! It is merely a placeholder that doesn’t produce a DOM element by itself.</p><p>There are two main implementations</p><p>1. Single slot content projection</p><p>2. Multi slot content projection</p><h3>Single-slot content projection</h3><p>The most basic one, but it could get the job done in most of the cases.</p><p>using the <strong>&lt;ng-content&gt;</strong> tag, it is replaced with another component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EjMsSdyDQZmXW6MLtq1ODw.png" /></figure><h3>Multi-slot content projection</h3><p>This is similar to the previous one, but it can have multiple slots for projections.</p><p>There is a selector that determines which content goes into the specific slot.</p><h3>What is a singleton service in Angular</h3><p>In Angular, we understand a service to be singleton, if only one instance exists in the application.</p><p>There are two ways to make a service singleton.</p><p>When created, in the @Injectable() we <strong>provideIn</strong> to <strong>root.</strong></p><p>It is provided in the AppModule or in any module that is only imported by the AppModule.</p><p>Another way is to handle the import with a static forRoot() to separate providers from a module.</p><p>I have an article on the subject</p><p><a href="https://medium.com/@dimitarg.stoev/using-forroot-and-forchild-in-angular-1b8fc2be2638">Using forRoot() and forChild() in Angular</a></p><p>The article also provides additional information on how to prevent a module and a service to be reimported somewhere else in the application.</p><h3>Design patterns in Angular</h3><p>There are so many books on design patterns that simply cannot be summarized in one single response.</p><p>There are many patterns that could be implemented and all solutions to problems that occur during software development and design depends on the understanding and the capacity of the team.</p><p>There are few patterns that are rooted in the Angular practices.</p><p>We mentioned one of them above</p><h3>The singleton pattern</h3><p>This pattern is a design pattern that ensures a service is used from the same instance.</p><p>I introduced the idea to make a service singleton through the entire application. But there is a way to make it singleton in a specific module.</p><p>Just provide the service in the desired <strong>@NgModule({})</strong></p><h3>Facade Pattern</h3><p>This is a structural design pattern that wraps a lot of complex logic and serves as a simplified interface to that logic.</p><p>It is very often used and implemented in Angular applications.</p><p>It’s useful if components need to interact with a lot of different services or state management systems.</p><p>Hiding that in a FacadeService could decrease the complexity of the ts component. Everything is provided through the FacadeService and it’s easier to maintain.</p><h3>Factory Pattern</h3><p>A creational design pattern that adds an abstraction over common base behavior between multiple objects of a generic type.</p><p>Meaning you have a superclass that allows its subclasses to alter the type of the objects that will be created.</p><p>It is used often in Angular to create different components or services based on some condition or Input.</p><h3>Observer Pattern</h3><p>A software design pattern that a subject maintains a list of its dependents, called observers and notifies them automatically of any state changes.</p><p>It is often used for implementing event handling systems in event driven software.</p><p>In Angular it keeps components in sync.</p><p>You guess it right that Observables play a crucial role here.</p><p>Working declaratively and event driven is a perfect way to create performative, maintainable and reactive applications.</p><p>I have an article that talks more on the Observables and Events</p><p><a href="https://medium.com/@dimitarg.stoev/how-i-work-with-observables-in-angular-f62ad60cf3fb">How I work with Observables in Angular</a></p><h3>Dependency Injection Pattern</h3><p>This is a very important design pattern that is a backbone for Angular itself. Developing large and scalable applications without it is hard!</p><p>There are many Design patterns and knowing all of them and using them could be time consuming and hard.</p><p>I have a plan to write some articles on some specific Patterns so stay tuned and give me a follow if you are interested!</p><h3>Structuring application</h3><p>As of my experience I have seen two ways to structure an application.</p><p>I have heard that all Angular apps at some point start to look alike and I believe there is a good reason for that.</p><p>It forces you to write good and quality front end code!</p><p>Regarding the structure, it is feature based and type based.</p><h3>Feature based Angular structure</h3><p>The best one, in my opinion.</p><p>Every functionality is divided by logic and positioned in a <strong>separate feature folder. </strong>Inside you nest your services, dumb components, constant information and so on, but entirely related to the feature!</p><p>Everything else should go either in a shared module or a core module.</p><p>Check the following article for more information on how I do that structuring.</p><p><a href="https://medium.com/@dimitarg.stoev/how-i-structure-my-angular-applications-d7d91a2da2e3">How I structure my Angular applications</a></p><h3>Type based</h3><p>This is a structure in which logic is divided by type and it is not separated by logic.</p><p>You have a folder for components, services, constant data and so on.</p><p>For small applications it is fine, but it can quickly become a mess for maintainability.</p><h3>Services</h3><p>Angular services are classes that are instantiated in the creation of the module and have a very specific purpose. To control data, manipulate information and organize business logic.</p><p>It can be used as a dependency and Injected in any component.</p><p>Services are encouraged to have only one purpose and serve specific logic.</p><p>It has to be <strong>providedIn</strong> the <strong>root</strong> or <strong>any other component</strong> in order to be used.</p><h3>Advantages of Angular</h3><p>I have worked with Angular and React in the past.</p><p>This is going to be a biased answer.</p><p>Angular is well more heavy and complete. It forces the devs to follow patterns, quality and it is made for enterprise and serious applications.</p><p>I have heard some full stack devs tell me that Angular is the front end that should be coded and I completely agree with that!</p><p>One of the advantages I find is:</p><p>1. Dependency Injection — controlling logic and state in big apps is easier</p><p>2. Difficult — some may think I am talking crap, but hear me out. Angular is harder and that means the devs have to learn more and more to get into it. The quality of devs is better.</p><p>3. Backed by Google — it means the long term game is secured.</p><p>4. Great resources — as I said, Angular devs tend to be more qualified and there are a lot of resources out there.</p><p>5. Easy testing — it comes out of the box.</p><p>6. It is actually reactive — in contrast to React… funny, right? React is actually not reactive?! WTF</p><p>7. It uses TypeScript out of the box — who is writing vanilla JS anyway these days.</p><p>Of course that doesn’t mean that there aren’t any cons and React is bad.</p><p>I mean.. it is bad, but if a good React devs set it up perfectly, it can make it as good as Angular.</p><p>I personally know great React devs, so I am not here to insult the dev community. It’s merely an observation I have made.</p><h3>What is a MVVM architecture</h3><p>This is an abbreviation of Model-View-ViewModel.</p><p>A software design pattern that is structured to separate program logic and user interface. The separation is as follows.</p><p>Model — This is the application’s data and business logic. It is in charge of retrieving and storing data from the database or API — interfaces, classes and types.</p><p>View — The user interface. It is in charge of displaying data to the user and recording user interaction — the HTML templates</p><p>ViewModel — a link and between the View and the Model — the components in Angular</p><h3>Angular inbuilt pipes</h3><p>Angular provides us with inbuilt pipes we can use to enhance the functionality of our components.</p><h4>date</h4><p>The date pipe is a pure pipe that transforms the format of the date.</p><p>The only local available with Angular is <strong>en-US</strong></p><h4>uppercase &amp; lowercase</h4><p>Transform the entire text to uppercase and lowercase respectfully.</p><h4>currency</h4><p>Transforms a number to a currency string.</p><p>It formats it according to locale rules.</p><h4>decimal</h4><p>Transforms a number into a string with a decimal point.</p><h4>percent</h4><p>Transforms a number to a percentage string, formatted according to locale rules.</p><h3>Change detection</h3><p>This is the process through which Angular checks for state changes.</p><p>Angular does that in specific cases. Triggering it can be done either manually or automatic.</p><p>It is very aggressive and every dev should try to optimize as much as possible.</p><p>It works by replacing the real event listeners in the browser APIs with a custom version that calls a callback that Angular utilizes for its change detection.</p><p>This is done thanks to zone.js</p><p>The default change detection strategy is performance heavy and aggressive. It checks every tree and it can quickly add up a lot of processes and worsen the performance.</p><p>To help that, <strong>onPush </strong>strategy is introduced that limits the way Angular runs its change detection mechanisms. It is run only in Input, event changes or async operations. It also skips the trees with onPush change detection if no triggerer ( event ) is present.</p><p>One thing people tend to forget is that change detection runs twice in development mode and only ones in production.</p><p>This is great for debugging purposes and sometimes can lead to unexpected behavior in development.</p><p>Pay attention to that!</p><h3>Conclusion</h3><p>This is not complete information, but a blueprint for what is important and what topics should be expanded and dived in.</p><p>Angular is too big and complex to understand for a few months or from a few articles.</p><p>As of the writing of this article, I have worked with it for around a couple of years and I still learn new stuff every few days.</p><p>It is a great choice for serious developers and it forces you to become a great programmer.</p><p>Happy coding and good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=408712f1d9c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular questions — PART 2]]></title>
            <link>https://medium.com/@dimitarg.stoev/angular-questions-part-2-6b2887a66f59?source=rss-f3e9f0377b09------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b2887a66f59</guid>
            <category><![CDATA[interview-tips]]></category>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[anguar]]></category>
            <dc:creator><![CDATA[Dimitar Stoev]]></dc:creator>
            <pubDate>Mon, 14 Aug 2023 19:24:12 GMT</pubDate>
            <atom:updated>2023-08-14T19:24:12.019Z</atom:updated>
            <content:encoded><![CDATA[<h3>Angular questions — PART 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KiOYp_1hG-fGh23CkbUTBA.png" /></figure><h3>Getting started</h3><p>This is the second of three articles on some of the most asked questions in Angular interviews. The list is nowhere near complete and every interview could be unique, depending on the interviewer.</p><p>But the knowledge and the common basics are usually the same.</p><p>Let’s write down what I am going to write about:</p><ol><li>Error handling in Angular</li><li>What is an Observable and Observer</li><li>Error handling in Observables</li><li>Subject, BehaviorSubject and ReplaySubject</li><li>Observable vs Promises</li><li>What is the * in Angular directives</li><li>Types of directives</li><li>ViewEncapsulation</li><li>ViewChild and ViewContent</li><li>What is a provider</li><li>Reactive forms</li><li>Template driven forms</li><li>Lazy loading</li><li>HTTP Interceptors</li></ol><h3>Error handling in Angular</h3><p>Error handling in Angular has a few ways to be achieved.</p><p>Using RxJS observables, errors could be cached by the catchError operator streamed in a pipe. This operator intercepts the error from the stream and allows for custom handling. It also returns a new Observable.</p><p>Another way to do it is HTTP interceptor. This is very useful for more as a global solution.</p><p>Custom error handler is also a viable option. A custom class, provided in the AppModule for <strong>ErrorHandler.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GFpOYjdRwKrbOK9mFrnzfw.png" /></figure><h3>What is an Observable and Observer</h3><p>I have an article on the subject with a demo project.</p><p>Check it out here for more information:</p><p><a href="https://medium.com/@dimitarg.stoev/how-i-work-with-observables-in-angular-f62ad60cf3fb">How I work with Observables in Angular</a></p><p>Answering the question.</p><p>Observables are declarative lazy push collections of multiple values. A stream of information. They could be divided into cold and hot ones.</p><p>Lazy means they emit nothing until they are subscribed!</p><p>In <strong>cold observables</strong> the data is produced inside the observable. When subscribed they emit the values, but it has to be pointed out that every subscription starts new execution!</p><p>This is called unicasting behavior.</p><p>The data is produced outside the <strong>hot observables</strong>. Since the information is not created in the observable, the data is created, even if nothing subscribes to it.</p><p>The Observer is the consumer of the value. Simply put a set of callbacks, one for each type of notification delivered by the Observable: <strong>next</strong>, <strong>error</strong>, <strong>complete</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*neXOE_wv_k2b1XsE4uurtA.png" /></figure><h3>Error handling in Observables</h3><p>This is very useful for catching and manipulating data in case of a problem. RxJS comes with a built in operator for that</p><p><strong>catchError</strong></p><p><strong>catchError(project : function): Observable</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zKtALCkB_Saea9f3ENiRpg.png" /></figure><h3>Subject, BehaviorSubject and ReplaySubject</h3><p>Very powerful Observables that allows values to be multicast to many Observers.</p><p>The difference is that Observables creates new execution with every subscription, while Subject as a type of Observables shares the same value to every Observer.</p><p>Internally the Observer is registered to a list of listeners and doesn’t invoke new execution.</p><p><strong>Every Subject is an Observer</strong></p><p>BehaviorSubject is a variant of Subject. It stores the last value and can deliver it on demand. It represents “values over time”.</p><p>Subject doesn’t require initial value, while BehaviorSubject does!</p><p>ReplaySubject is similar to BehaviorSubject and also sends old values, but it can also record a part of the Observable execution.</p><h3>Observable vs Promises</h3><p>This question is tricky.</p><p>Both Promises and Observables provide us with abstractions that help us deal with the asynchronous nature of the application.</p><p>Observables are lazy and nothing is executed, until subscribed. On the other hand Promises are eager and start immediately once defined.</p><p>Promises return only one response, while Observables can emit multiple values.</p><p>Promises are executed and nothing can stop them! Observables on other hand, are cancelable.</p><p>Observables also add a lot more functionalities with RxJS operators.</p><h3>What is the * in Angular directives</h3><p>The asterisk is a little magic Angular adds to the pool. This convention is shorthand that Angular interprets and converts into a longer form.</p><p>It is transformed into a &lt;ng-template&gt; tag that surrounds the host element and its descendants.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FIPgUvCQ4_VaM6TjkLZRCg.png" /></figure><p>That usually leads to another question:</p><h3>Types of directives</h3><p>The directives in Angular are attributes that allow HTML template enhancements and add behavior to an existing DOM element.</p><p>There are:</p><ol><li>Component directives — used with a template. This type of directive is the most common directive type</li><li>Structural directives — change the DOM layout by adding and removing DOM elements</li><li>Attribute directives — change the appearance or the behavior of an element, component, or another directive</li></ol><h3>ViewEncapsulation</h3><p>This defines the way CSS styles are encapsulated. The types are:</p><ol><li>Emulated — the default option. It adds a specific attribute to the component’s host element and applies the same attribute to all CSS selectors.</li><li>None — this removes all encapsulation, meaning the styles here are applicable to any HTML element of the application</li><li>ShadowDom — uses the browser’s native Shadow DOM API to encapsulate CSS styles</li></ol><p>What does Shadow DOM mean?</p><p>It allows hidden DOM trees to be attached to elements in the regular DOM tree. It introduces <strong>scoped styles </strong>to the web platform.</p><h3>ViewChild and ViewContent</h3><p><a href="https://www.stoev.dev/blog/angular-view-children-and-content-children">Angular View Children and Content Children</a></p><p>ViewChild of given components is the element used <strong>within</strong> its template. It is a reference to it.</p><p>ViewContent is similar to the ViewChild, but the element is <strong>projected </strong>from the host component.</p><p>For more in-depth explanation and examples, check the article above.</p><h3>What is a provider</h3><p>Angular relies heavily on Dependency Injection.</p><p>Providers are instructions on how to obtain a value for a dependency.</p><p>When a service is provided to the root application injector, it’s available throughout the entire application.</p><p>It is recommended to do so!</p><p>Of course providing a service only to a specific module is possible.</p><p>When creating a service with the Angular CLI, it is provided in ‘root’.</p><p>When lazy loading a module, the services provided in the root are not the same created for the new module. Every component created with a lazy loaded module’s context, gets its own local instance of child provided services.</p><h3>Reactive and Template forms</h3><p>I also have an in-depth article on the subject.</p><p><a href="https://medium.com/@dimitarg.stoev/introduction-to-reactive-forms-in-angular-62d378fb5dc9">Introduction to Reactive Forms in Angular</a></p><p>Reactive forms could be described as a model-driven approach for creating forms in a reactive style. It follows an observable stream pattern, where form inputs and values are provided as streams of input values.</p><p>Template driven relies on directives in the template to create and manipulate the underlying object model. They are usually used for simple forms, since they are straightforward to add and implement.</p><p>Template driven forms doesn’t scale that well as Reactive forms</p><h3>Lazy Loading</h3><p>By default, modules are eagerly loaded in Angular. The moment the application is loaded, so do all modules.</p><p>Lazy loading is a design pattern that loads NgModules as needed. The initial bundle size is smaller.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QCbKbmYo4sCvbhEDnt-VZg.png" /></figure><p>I have an article on the topic on structuring Angular applications and I briefly talked about Lazy loading and how I implement it.</p><p>Check it out here:</p><p><a href="https://medium.com/@dimitarg.stoev/how-i-structure-my-angular-applications-d7d91a2da2e3">How I structure my Angular applications</a></p><h3>HTTP Interceptors</h3><p>Http Interceptors handle HttpRequests or HttpResponses</p><p>Very useful for manipulating received data.</p><p>Most interceptors also transform the outgoing request before passing it to the next interceptor in the chain.</p><p>They are usually added to the root application Injector in the AppModule.</p><p>If HttpClientModule is imported across different modules, each import creates a new copy of the HttpClientModule, which overwrites the interceptors provided in the root module.</p><h3>Conclusion</h3><p>All of this, as mentioned, in the previous article is nowhere complete or in-depth.</p><p>Those questions could be used as a starting point to diving into the Angular framework or as a list to remind yourself and don’t forget the technology.</p><p>Take care and happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b2887a66f59" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular questions — PART 1]]></title>
            <link>https://medium.com/@dimitarg.stoev/angular-questions-part-1-cd18e477dff6?source=rss-f3e9f0377b09------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd18e477dff6</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[interview-tips]]></category>
            <dc:creator><![CDATA[Dimitar Stoev]]></dc:creator>
            <pubDate>Mon, 14 Aug 2023 19:16:53 GMT</pubDate>
            <atom:updated>2023-08-14T19:16:53.865Z</atom:updated>
            <content:encoded><![CDATA[<h3>Angular questions — PART 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KiOYp_1hG-fGh23CkbUTBA.png" /></figure><h3>Why another list of Angular questions?</h3><p>We already have like a million angular interview questions out there. Then why am I building another one?</p><p>Simple — I wanted to summarize information for me and give a starting point for more in-depth learning. So this is mostly a blueprint for what should be learned and observed!</p><p>Showing understanding is positioning yourself above the crowd.</p><p>As for the “for me” part. I am summarizing information, because I want to have some easy access to something if I need it.</p><p>With that clarified, let’s go!</p><ol><li>Angular — how does it work?</li><li>Angular lifecycle hooks</li><li>What is a module</li><li>CommonModule in Angular</li><li>Pipes</li><li>Pure and impure pipes</li><li>Async pipe vs manual .subscribe()</li><li>Template expression and Template statement</li><li>Dependency Injection</li><li>Data binding</li><li>Interpolation</li><li>JIT vs AOT</li><li>What is zone.js</li><li>Angular material</li></ol><h3>Angular — how does it work</h3><p>Getting most of the information here is hard, but we can point to the most important aspects.</p><p>After the Angular CLI creates a fresh angular project, we can find angular.json file in the root directory. Inside the file, a few mentions are important — “src/main.ts”, “src/index.html” and the “tsconfig.app.json” files.</p><p>The main.ts file creates a browser environment for the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cMDB6Hxpp-QJfagfanyy-g.png" /></figure><p>The AppModule is bootstrapped. That module itself contains all the information about the component the project requires. In that itself a few arguments could be passed. The types could be seen here</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JCafcMr59sNUKmW3FKPyBA.png" /></figure><p>After the initialization, the project is compiled and it has the following building blocks</p><ol><li>Modules</li><li>Components</li><li>Services</li><li>Templates</li><li>Directives</li><li>Dependency Injection</li><li>Metadata</li></ol><p>I am going to explain more about these topics in the following lines and in the next two articles I have prepared.</p><p>For some ready and basic functionality Angular provides us with some built in modules, pipes and directives.</p><p>The flow is as follows. The component receives through the Injector services that it can utilize. The main TS file communicates with the HTML through Property and Event Binding.</p><p>Directives are used to enhance the HTML template. All of them require Metadata.</p><h3>Angular lifecycle hooks</h3><p>Knowing the lifecycle hooks is pretty essential to building performance, working and sufficient code.</p><p>We have the following in disposal:</p><ol><li>ngOnChanges</li><li>ngOnInit</li><li>ngDoCheck</li><li>ngAfterContentInit</li><li>ngAfterContentChecked</li><li>ngAfterViewInit</li><li>ngAfterViewChecked</li><li>ngOnDestroy</li></ol><h4>ngOnChanges</h4><p>This method is called when the value of a data bound property changes.</p><p>Keep in mind the way JavaScript manages objects by reference.</p><p>It’s called before the ngOnInit method.</p><h4>ngOnInit</h4><p>This method is called the moment Angular displays the data-bound properties. Whenever the initialization of the component is done.</p><p>This is the place you can access the information you pass with the <strong>@Input().</strong></p><h4>ngDoCheck</h4><p>This method is for detection and to act on changes that Angular is not detecting on its own.</p><p>It’s called immediately after the <strong>ngOnChanges()</strong> and it runs immediately after the <strong>ngOnInit()</strong></p><p>Avoid as much as possible, since it’s not performance friendly.</p><h4>ngAfterContentInit</h4><p>That method is called after the external content is loaded into the view. Or into the view that a directive is in.</p><p>It’s called once after the first <strong>ngDoCheck()</strong>.</p><h4>ngAfterContentChecked</h4><p>Respond after Angular checks the content projected into the directive or component.</p><p>It’s called after <strong>ngAfterContentInit() </strong>and every subsequent <strong>ngDoCheck()</strong></p><h4>ngAfterViewInit()</h4><p>Respond after component’s views and child views initialization.</p><p>Called once after the first <strong>ngAfterContentChecked()</strong></p><h4>ngAfterViewChecked()</h4><p>Respond after component’s views and child views are checked.</p><p>Called after the <strong>ngAfterViewInit()</strong> and every subsequent <strong>ngAfterContentChecked()</strong></p><h4>ngOnDestroy()</h4><p>This method is called just before Angular destroys the component or the directive.</p><p>It’s very useful for unsubscribing or managing state.</p><h3>What is an Angular module?</h3><p>In Angular, modules are collections of building blocks. It could include components, services, templates, directives and pipes.</p><p>It’s usually logically separated from the rest of the application and could be exported and imported.</p><p>It is structured with a metadata decorator in the following example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5eAQfPBIQ2s8y4MhTn8PIw.png" /></figure><p>The providers option is used to configure a set of injectable services that are available in the injector of the module.</p><h3>CommonModule in Angular</h3><p>I have a whole article on the subject.</p><p>This is the very basic module angular has. It adds all fancy HTML attributes and directives — like *ngIf, *ngFor and etc.</p><p><a href="https://medium.com/@dimitarg.stoev/what-is-commonmodule-in-angular-4aa712b704b2">What is CommonModule in Angular</a></p><h3>Pipes | Pure and Impure</h3><p>Short representation of “pipeline” is a function that is designed to accept an input value, transform it ( process ) and return it as an output.</p><p>Some key features:</p><ol><li>It could be both pure and impure — Pure pipes use pure function. Meaning Angular calls the pipe only when it detects a change in the arguments passed. The default state of the pipe is “pure”.<br>Impure pipes are called with every change detection.</li><li>Could be chained with each other — That is one of the best features ever. The output of a pipe could be used as an Input of another pipe and so on.</li><li>Pipes can take as many arguments as needed.</li></ol><h3>Async pipe vs .subscribe()</h3><p>This question is not really “vs” and using a manual subscription could be needed.</p><p>Most of the cases with proper observable management is not necessary and it could be used directly in the template with the <strong>| async</strong> pipe.</p><p>I have a great article on the subject!</p><p>Async pipe in general subscribes to an observable or promise and returns the latest value that is emitted.</p><p>It also marks the component to be checked for changes when a new value is emitted.</p><p><a href="https://medium.com/@dimitarg.stoev/how-i-work-with-observables-in-angular-f62ad60cf3fb">How I work with Observables in Angular</a></p><p>Key features:</p><ol><li>Async pipe subscribes and unsubscribes from the observable.</li><li>Could be used as conditional rendering directly in the template with <strong>*ngIf</strong> directive.</li><li>It is associated with Declarative programming and proper Observable management.</li></ol><h3>Template expression and Template statement</h3><p>Well, I have another article on the subject.</p><p>It is actually very simple.</p><p>The template expression is executed by Angular and assigned to a property that is binded in the template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6iuLYBI8R5adhi8Cps23Xw.png" /></figure><p>Template Statement on the other hand is reversed. It responds to an event raised by a binded target.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l6fbARLPh5dIY4zmqZXXeg.png" /></figure><p>You can read more here:</p><p><a href="https://www.stoev.dev/blog/angular-data-binding">Angular Data Binding</a></p><h3>Dependency Injection</h3><p>That is a question that requires an article on its own.</p><p>This is an important application design pattern that is not strictly connected to Angular.</p><p>It is a mechanism for creating and delivering some parts of an application to other parts of an application that requires them.</p><p>The dependencies are usually services, but could be values, such as strings or functions.</p><p>An injector for an application instantiates dependencies when needed, using a configured provider of the service or value.</p><h3>Data binding</h3><p>Data binding is the process and concept of communication between the template ( the DOM ) and the component.</p><p>It allows us to have dynamic and interactive applications.</p><p>There are four ways to communicate in Angular</p><ol><li>Interpolation — from the component to the template</li><li>Property binding — the value is passed from the component to a specially defined attribute.</li><li>While the interpolation allows only primitive data to be passed and converts it as a string, property binding has no problem with other types. It could be an object, array and so on.</li><li>Events — event binding is the ability to send information back to the component from the template. It could be click, change or custom.</li><li>Two way data binding — Angular is awesome with that. The data could flow in both directions! From the component to the template and vice versa.</li></ol><h3>Interpolation</h3><p>This is a type of data binding. In Angular it’s represented with double curly braces and converts the data to string.</p><p>Angular embeds the expressions into marked up text.</p><h3>JIT vs AOT</h3><p>Let’s define what JIT and AOT are.</p><p>JIT is an abbreviation of Just in time Compilation.</p><p>This means that JavaScript is compiled in the browser, during runtime. It compiles just before running and each file is compiled separately.</p><p>It’s very useful and suitable for local development.</p><p>AOT on the other hand means Ahead of Time. Meaning it is compiled at build time. The code is compiled to native machine code.</p><p>It’s great because the browser downloads a pre-compiled version of the application.</p><p>It’s faster!</p><p>After Angular 9, the default is AOT.</p><h3>What is zone.js</h3><p>Important topic for Angular and the way it detects changes.</p><p>Zone.js is a library that serves as a signaling mechanism that captures operations like event listeners and requests.</p><p>The way this happens is Zone.js adds or changes the default behavior of elements without changing the source code. A zone aware event listener will pick the <strong>.addEventListener </strong>and will monitor it. When it is executed, a wrapper function is also executed in order for Angular to pick it up.</p><p>We have two zones in disposal here: the outer zone and the inner zone.</p><p>The outer zone is provided by Zone.js and runs outside Angular. So it won’t trigger any change detection.</p><p>The inner zone is implemented in NgZone and extends the functionality. Everything triggered here will trigger change detection.</p><p>Something to be mentioned here — we can run Angular without zone.js as a dependency, but this means we have to trigger all changes and handle them ourselves.</p><p>To remove it, remove the import in the <strong>polyfills.ts</strong> and bootstrap it with <strong>ngZone: ‘noop’</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M9EC4WFI_N0XLMRZ4eX7Eg.png" /></figure><h3>What is Angular Material</h3><p>Angular Material is a library of Material Design ready to use components.</p><h3>Conclusion</h3><p>Everything you have read could be expanded in an article on itself. But answering Angular interview questions should be followed with examples and concepts.</p><p>When answering a question, answer from real experience.</p><p>Personal projects are an experience too.</p><p>When describing Data binding, show and explain examples that were interesting and challenging.</p><p>Never just answer the question and call it a day.</p><p>Be communicative and show you are interested in the framework.</p><p>Take care and see you in part 2!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd18e477dff6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular concept view in 5 minutes]]></title>
            <link>https://medium.com/@dimitarg.stoev/angular-concept-view-in-5-minutes-65054ac459af?source=rss-f3e9f0377b09------2</link>
            <guid isPermaLink="false">https://medium.com/p/65054ac459af</guid>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Dimitar Stoev]]></dc:creator>
            <pubDate>Sat, 01 Jul 2023 11:32:30 GMT</pubDate>
            <atom:updated>2023-07-01T11:32:30.982Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sucCFSKmg6kT4NLMLdA1tg.png" /></figure><h3>Disclaimer and Introduction</h3><p>The first time I was introduced to Angular, I watched some articles and videos of the framework and now coming back to them seems a little odd. I find it strange that most resources for beginners out there are too.. oversimplified and don’t give an idea on what is best practice and real project advice.</p><p>That’s why a lot of people entering in the field with this framework are a little surprised on how actual Angular looks like.. and Angular could be very beautiful and under-appreciated in my personal opinion.</p><p>But I want to put the disclaimer here because what I consider a good practice, another developer could have another opinion.</p><p>In fact, I could say that this article is also a reference to myself and the way I prefer to handle the framework.</p><p>This article by any means is not a complete guide.</p><p><strong>THIS IS NOT A TUTORIAL OR LEARNING MATERIAL, BUT A GUIDANCE ON WHAT IS IMPORTANT AND SHOULD BE LEARNED!</strong></p><p>With that clear, let’s start!</p><h3>Folder structure</h3><p>I have an article on the subject.</p><p>My preferred way to structure the project is by feature based structure.</p><p>Every logically separated functionality / feature should be in its own folder with subcomponents, subservices and pipes/directives.</p><p>Dividing the logic means easier maintainability, navigating and easier developing flow.</p><p>Shared logic could be extracted to another module / stand alone components /.</p><p>You can read the article here:</p><p><a href="https://medium.com/@dimitarg.stoev/how-i-structure-my-angular-applications-d7d91a2da2e3">How I structure my Angular applications</a></p><h3>HTML templates</h3><p>This topic is very connected to the second one I am going to talk about Observables and RxJS.</p><p>In my templates I really love to use *ngIf and *ngTemplateOutlet directives. I usually assign variables in the templates with the <strong>async </strong>pipe and use the object directly.</p><p>I am subscribing and unsubscribing in the template.</p><p>That is something I usually don’t like in the beginner articles. Although http requests don’t require unsubscribing by default, not mentioning at all unsubscribing itself is kind of problematic.</p><p>I know it’s a complex topic and not something that could be taught in 5 minutes, but people should at least mention it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rO3Kytzffr6rXkiYuGyUQg.png" /></figure><p>Another thing to mention is to extract what could be extracted in pipes and directives.</p><p>I usually use <strong>pure </strong>for specific transformation.</p><p>An example could be a<strong> filter pipe.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hQ_xcmNAn1E2-mdZhU2ISw.png" /></figure><p>Let’s give the overview here:</p><ol><li>Using *ngIf to subscribe to observables with async pipe. If there are many variables to subscribe to, perhaps you should combine them through RxJS.</li><li>Divide logic and pass arguments ( if any ) to a <strong>*ngTermplateOutlet</strong> directive.</li><li>Using custom <strong>pure</strong> <strong>pipes</strong> and directives as much as possible</li></ol><h3>RxJS and TS files</h3><p>Learning to think declaratively is key here!</p><p>When I approach a problem, I always consider what is my entry point for the screen. And I plan everything in Observables in advance.</p><p>Since I have an article on that topic as well, I am not going to dive a lot here.</p><p>The plan is simple — use declarative approach as much as possible. I usually extract more complex logic in the service and use it “declaratively” in the Ts file.</p><p>Learning RxJS is one of the best single things you can use.</p><p>To be honest, I have found myself in a situation where I implement RxJS with other frameworks. It’s just an incredible library!</p><p>Preparing the correct data with <strong>RxJS pipes</strong> and passing it to the template with <strong>custom made pipes</strong> makes Angular very beautiful.</p><p>The article about Observables could be found here:</p><p><a href="https://medium.com/@dimitarg.stoev/how-i-work-with-observables-in-angular-f62ad60cf3fb">How I work with Observables in Angular</a></p><h3>Change Detection Strategy</h3><p>When I create a component, the first thing I do is change the change detection strategy.</p><p><strong>OnPush </strong>is my default way.</p><p>Since in Angular, the change detection is very aggressive, we are provided with a way to limit the conditions on which it is run.</p><p>Using OnPush strategy with RxJS and pure pipes means insanely optimized applications.</p><h3>Interceptors</h3><p>What is an Angular application without HTTP requests?</p><p>In Angular, interceptors allow us to modify the outgoing request, handle errors, add headers and transform the response before it reaches the application.</p><p>I love it for catching errors and handling logic there.</p><p>If you find yourself in a situation where you want to send specific information with every request, maybe you need that.</p><p>It could be used perfectly for transforming data as well.</p><h3>Conclusion</h3><p>I love this framework. The more I study it, the more I understand how a proper front end should be handled.</p><p>I have worked with other frameworks and when it comes to serious applications, Angular is the only choice for me. Not React, not Vue..</p><p>For something small maybe Svelte, but Angular is insane!</p><p>Learning more of the concepts above is a great starting point for becoming great in Angular.</p><p>Use it as a guide and jumping point to learning resources.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65054ac459af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Reactive Forms in Angular]]></title>
            <link>https://medium.com/@dimitarg.stoev/introduction-to-reactive-forms-in-angular-62d378fb5dc9?source=rss-f3e9f0377b09------2</link>
            <guid isPermaLink="false">https://medium.com/p/62d378fb5dc9</guid>
            <category><![CDATA[reactive-forms]]></category>
            <category><![CDATA[angular-reactive-form]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Dimitar Stoev]]></dc:creator>
            <pubDate>Wed, 31 May 2023 13:11:55 GMT</pubDate>
            <atom:updated>2023-05-31T13:11:55.365Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KuCtaotW_zhCesIcRXrtdw.png" /></figure><p>I am yet to see an Angular application without some kind of a form. The power of Internet two is the ability to create user content and express ourselves. Nothing of that could happen without the communication between the front end and the back end technologies.</p><p>I am not going to talk about protocols, network or REST. I am going to dive a little bit into the ways of Angular to collect the information.</p><p>Two ways to do it — template driven and reactive forms.</p><p>I am talking about Angular Reactive forms today.</p><h3>What is the difference between template driven and reactive forms?</h3><p>Good question!</p><ul><li>The name “<strong>template driven</strong>” forms comes from the way they are structured. It follows a declarative approach where the form itself and the validations are defined in the HTML.</li><li><strong>Reactive forms</strong> take a more programmatic approach, where you validate and define using TypeScript.</li><li><strong>Template driven</strong> forms use <strong>Two-way data binding </strong>to communicate with their “model”</li><li><strong>Reactive forms</strong> use <strong>form controls that are treated as streams of data</strong> — aka. <strong>Observables</strong> that can be observed and reacted upon.</li><li>Compared to Reactive forms, you have <strong>limited control with Template driven forms</strong>.</li></ul><p>How do I prefer to use them?</p><p>I find template driven forms useful in controlling the UI ( like a checkbox for example ). Conditional rendering based on some specific input.</p><p>Less complex forms, although I am starting to switch to “Always reactive forms”.</p><p>Reactive forms are easier to work with. Even though the set up is heavier and the complexity is a little bit more, Angular reactive forms are way too powerful and have to offer so much.</p><p>Another thing I like more about Reactive forms is they tend to be more “structured”. It is strict and maintainable. I don’t have to look in the entire HTML template in order to find all I want.</p><p>Controlling the entire form in the component class is just great. This is the way it should be.</p><h3>Setting up Reactive Forms</h3><p>In order to use the reactive forms you have to set up the module and import the dependencies.</p><p>It is done through the ReactiveFormsModule from the @angular/forms. This provides all the necessary classes and functions for our reactive forms to work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GRgbFUO4XxiVStsJism2cQ.png" /></figure><p>With this we will have the option to use some special binding such as formGroup, formGroupName, ngSubmit and more.</p><p>One of the most important classes I am going to import is the FormBuilder. A class that comes with great features:</p><ul><li><strong>control</strong> () — you can create individual form control. It returns a <strong>FormControl</strong></li><li><strong>group</strong> () — this is the main method to create the form group.An object that utilizes the keys as form control names. It returns a <strong>FormGroup</strong></li><li><strong>array</strong> () — A method that returns a <strong>FormArray</strong> instance. Incredibly powerful</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VC9f6vRUTp9fFF2CvDPn0w.png" /></figure><p>You can even nest FormGroups!</p><p>But what exactly is Form Control and Form Groups?</p><h3>FormControl</h3><p>This is the building block of reactive forms. It represents an individual input field within the form and tracks its value, validation status and every used interaction.</p><p>One thing I want to mention is that <strong>FormControl</strong> is a class that <strong>extends AbstractControl</strong>.</p><p>We bind it to the template with the <strong>formControlName </strong>and use the correlated name or we just provide the entire control. It goes directly to the input element.</p><p>Some useful methods I want to present to you are:</p><ul><li>valueChanges — observable that fires every time a value is changed</li><li>setValue — sets a new value for the form control</li><li>patchValue — <strong>it acts the same as setValue</strong> when it comes to <strong>FormControls</strong></li><li>updateOn — FormHooks that represents the update strategy</li><li>setValidators, removeValidators — useful methods to control the validators of the FormControl</li></ul><h3>What about FormGroups?</h3><p>While FormControl represents an individual input field, FormGroup allows you to group related form controls together. It allows you to manage the state, validation and values as a single entity.</p><p>It is way easier to keep track of the validity of the entire form you have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QUAa2iudKVb3mBlITDh-EQ.png" /></figure><p>How does it do it?</p><p>While we instantiate the new FormControl we can provide some arguments in the constructor. One of them is the <strong>ValidatorFn. </strong>A function that receives a control and synchronously returns a map of validation errors if present, otherwise null.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K9jCRKKuvk3jA9fHWgC77g.png" /></figure><h3>Form Builder</h3><p>A helper class provided by the Reactive Forms module that simplifies the entire process of building the form.</p><p>It offers declarative ways to build complex forms.</p><p>The most important method here is the <strong>group</strong> — accepts an object which contains all the keys and corresponding inner control types.</p><p>One other great feature is that <strong>we can dynamically create and modify form controls!</strong></p><h3>Dynamic Forms</h3><p>Reactive forms just shine here!</p><p>Let’s say we are building a form that needs to be dynamic. We need an address, but we are not sure how many addresses people have. What is the solution?</p><p>We allow multiple ones.</p><p>But how do we do it if we said we define the form itself in the FormBuilder.</p><p>Easy. We use the power of arrays. FormArrays!</p><p>That’s a class that represents an array of multiple <strong>FormGroups</strong> or <strong>FormControls.</strong> It also provides methods to add or remove such.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v-i4lhIJkpIC3gmDiiGYcQ.png" /></figure><p>The initial setup could be a little tricky if you are doing it for the first time. I remember it was a little bit confusing when I was trying to do it.</p><p>We add controls with the <strong>push()</strong> method and <strong>removeAt()</strong> to .. well… to remove.</p><p><strong>console.log(address.at(0).value); // Access the value of a specific control</strong></p><h3>The Flow</h3><p>Let’s show the flow of creating everything in images. I guess it’s going to be useful to visualize it.</p><ul><li>we import the reactive form module</li><li>define the form builder</li><li>create the form group</li><li>set up arrays ( if any )</li><li>bind to the HTML</li><li>control the events and submission</li></ul><p>Easy!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yC4OgPXrXOtZInND7T0E9Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6RXrfi-ILrzjk5qkUT4mvg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vFROsjq-BHC0QVa92jCrRQ.png" /></figure><h3>Repository</h3><p>If you already follow me, you know there would be a repo with the code.</p><p>Have a look here.</p><p><a href="https://github.com/dimitar-stoev/dimitar-stoev-tutorials/tree/reactive-forms">https://github.com/dimitar-stoev/dimitar-stoev-tutorials/tree/reactive-forms</a></p><p>You can check a <strong>custom Validation function</strong>, set up based on my <strong>preferred Angular application structure</strong> and more.</p><p>Don’t forget to “<strong>star</strong>” the project. It would be awesome!</p><h3>Conclusion</h3><p>Reactive forms are the best way to handle complex logic and data.</p><p>It’s my preferred way of creating user interactions. Although I sometimes use template driven forms, it’s on very rare occasions.</p><p>Reactive forms are dynamic, reactive ( I know, I know ) and more declarative.</p><p>Play around and find out!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62d378fb5dc9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Dynamic Components in Angular]]></title>
            <link>https://medium.com/@dimitarg.stoev/getting-started-681505c7681c?source=rss-f3e9f0377b09------2</link>
            <guid isPermaLink="false">https://medium.com/p/681505c7681c</guid>
            <category><![CDATA[webdev]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[dynamic-components]]></category>
            <dc:creator><![CDATA[Dimitar Stoev]]></dc:creator>
            <pubDate>Sun, 14 May 2023 13:38:49 GMT</pubDate>
            <atom:updated>2023-05-14T13:40:24.365Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2vpFVzT5YRXGUhlZB1-gA.png" /></figure><h3>Getting started</h3><p>Hey, Angular fans, and</p><p>Здравейте, приятели!</p><p>I am diving more into Dynamic Components and the importance and crucial role they play in developing flexible Angular applications.</p><p>I happened to “meet” them relatively late in my Angular career and as far as I see, there aren’t too many articles and content in general about it.</p><p>So.. what is it?</p><p>Why do we need it?</p><p>When could we benefit from it?</p><p>I am going to define the Dynamic Components for you and make a contrast to static components, highlighting their advantage and use case.</p><p>Second — we will dive a little bit more on how to manage them.</p><p>So what am I going to show you and build for you?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5zHOgTf7Q2r6M_uLbf9dHg.gif" /></figure><h3>Definition and Information</h3><p>The difference with standard components is that when we talk about dynamic ones, we mean they are not defined at build time, but at run time.</p><p>This allows us to create components based on user input or dynamic data.</p><p>They are not defined in the template, but rather rendered dynamically.</p><p>Perfectly flexible and reusable.</p><h3>Creating a Dynamic Component</h3><p>The initialization of the Dynamic Components is straightforward and you already know how to make one.</p><p>You generate a component through the CLI and register it in a module as usual.</p><p>Nothing new here!</p><p>For components that I plan to use dynamically, I usually register them as standalone components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fx9sjro8ZVzTbaLBQ3NwBQ.png" /></figure><p>I have talked to some people who thought that dynamic components are some special components, but that’s wrong.</p><p>It’s the same component, just the way we render and create it is different.</p><p>The component is just rendering information based on inputs.</p><p>I know it’s nothing interesting, but it’s to get the idea.</p><p>The HTML is as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ojnTQPYQT4kDLRWeOi8YwQ.png" /></figure><p>The basic “widget” component is looping through the config and displays the key as title and the value of information as paragraph.</p><p>Beautiful, right?</p><p>Now let’s go to the interesting part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CsuQI-CbsquoQOGeLv1eUA.png" /></figure><p>We have three buttons and every one of them calls the method of dynamic component creation for a certain type. Based on the type we “pull” the correct data. I am not going to use a service here and mock a response. Just simple constant data.</p><p>Since we are grabbing the “container” we have to “clear” it in every call. If we don’t, we will end up with multiple components.</p><p>Now let’s see what is “component” and “inputs”.</p><p>We see that we are extracting the data from optionsByType().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PMXiOAMbkkTmXxOKEFVrfQ.png" /></figure><p>The powerful thing is you can load any type of component and any type of data. Making it truly dynamic.</p><p>This is perfectly enough for Angular to create the component for us.</p><p>You can check the repo listed below and see everything as it is.</p><h3>Use cases</h3><p>Using dynamic components depends on the situation. Some of the most real world use cases are</p><ol><li>Dynamic Forms — creating a dynamic section or fields</li><li>Modals | Dialogs — not every time a library is needed or sufficient</li><li>Widgets — not as simple and stupid as the current app I am showing you ( I hope so )</li><li>Data visualization — rendering different charts and data ( personal favorite )</li><li>Conditional rendering — you can show components depending of the user input )</li></ol><h3>Repository</h3><p>Dynamic Components are something that is not usually the first choice for many devs out there.</p><p>You need to play with them in order to understand them relatively well.</p><p>Here is the promised repo you can check. A simple “project”, but enough to get you started!</p><p><a href="https://github.com/dimitar-stoev/dynamic-components">https://github.com/dimitar-stoev/dynamic-components</a></p><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=681505c7681c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I use NgTemplateOutlet in Angular — Part 1]]></title>
            <link>https://medium.com/@dimitarg.stoev/how-i-use-ngtemplateoutlet-in-angular-part-1-73baf1ba5d65?source=rss-f3e9f0377b09------2</link>
            <guid isPermaLink="false">https://medium.com/p/73baf1ba5d65</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[ngtemplateoutlet]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Dimitar Stoev]]></dc:creator>
            <pubDate>Sun, 07 May 2023 09:00:10 GMT</pubDate>
            <atom:updated>2023-05-07T09:00:10.508Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I use NgTemplateOutlet in Angular — Part 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w6y-M1Hx5tVX6Pz5uPxD0g.png" /></figure><h3>Introduction</h3><p>This is a directive that is always neglected and people tend to not use it. Either because they do not fully understand the use cases or simply because they don’t know they exist. I have seen it! I know!</p><p>When I first encountered it I wasn’t really sure where and why I would need it when I could simply create another component, or a switch case.</p><p>It brings dynamic to your template and you can create reusable components with ease.</p><p>It’s great for performance reasons and simplicity.</p><h3>Getting Started with NgTemplateOutlet</h3><p>What exactly is ngTemplateOutlet?</p><p>It is a structural directive that allows you to render templates dynamically. Pieces of HTML that is used to define the user interface of a component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vRS0BNw3xspCe8gV.png" /></figure><p>Of Course in 99% of cases you will import the commonModule itself and not specifically the NgTemplateOutlet, but I wanted to highlight to you where exactly it is.</p><p>First, we define the template — in our case it is <strong>#details </strong>and I want to point out that this is not the position it will be rendered! We are merely defining it. The position it will be rendered is where the <strong>ng-container</strong> is located with the correct variable. The template is NOT rendered by default.</p><p>Angular will replace the content in the ng-container with the information we have<strong> inside the template</strong></p><h3>Understanding the Directive</h3><p>Behind the scenes Angular is creating a new view and setting variables for the template we create. This directive takes an object as its input and Angular creates a new scope for us. It fills the template with the information we provide inside</p><p>Under the hood Angular creates a template and we can reuse it in different conditions.</p><p>What is different with that Directive is that it has its context. We can pass data and work with the template dynamically.</p><p>Let’s give an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-GmFSRJhbHyUNDJ8.png" /></figure><p>As you can see in the example — I define a property called “<strong>user_name</strong>” inside the ng-template and assign it to “<strong>name</strong>”. And that name is passed from the “<strong>context</strong>” in the <strong>ngTemplateOutlet</strong>.</p><p>I have to admit that the first time I encountered that I was a bit confused, but after a while it all makes sense.</p><h3>Usage of NgTemplateOutlet</h3><p>As I stated in the title — it is the way I usually use the ngTemplateOutlet. And the most often use case I do use it for is to create and control tables.</p><p>I will explain more on this, but let’s mention another use case — it could be used for rendering dynamic information and to reuse code in the template, if you don’t want to create another component.</p><p>Simple and yet effective. Since you can pass information, you create your mini separate component directly in the template.</p><p>Another use case I sometimes find myself is to “separate” logic in the template.</p><p>Let’s describe it as a “method” in the HTML template. It’s great since I can provide params into the “function” and it works perfectly.</p><p>It’s great to divide logic.</p><h3>Conclusion</h3><p>In part two I will create a demo repo with examples on the way I use it for tables.</p><p>I have been planning on this for a long time, because I always wanted to create a configurable table I would use on many occasions and on many projects.</p><p>I am going to build it and publish it as a package, in order to reuse it myself.</p><p>There are great and awesome libraries out there, but I always find unique cases that force me to fight the library in order to get something done.</p><p>So in a sense I am gonna build it for myself, but hey, if you find it useful — I am happy!</p><p>Stay tuned, follow and feel free to contact me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73baf1ba5d65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using HttpClient, HttpBackend and Observables to consume RESTful APIs]]></title>
            <link>https://medium.com/@dimitarg.stoev/using-httpclient-httpbackend-and-observables-to-consume-restful-apis-420213ba3a3d?source=rss-f3e9f0377b09------2</link>
            <guid isPermaLink="false">https://medium.com/p/420213ba3a3d</guid>
            <category><![CDATA[http-client]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Dimitar Stoev]]></dc:creator>
            <pubDate>Sun, 23 Apr 2023 11:11:17 GMT</pubDate>
            <atom:updated>2023-04-23T11:11:17.698Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4otvH8SU5OUuJkUCehD2Tg.png" /></figure><h3>Introduction</h3><p>Angular is an incredible framework and I love working with it!</p><p>Playing around and browsing the source code is an incredible learning opportunity.</p><p>One essential feature is the ability to send requests and receive data from the backend server.</p><p>What is an application that doesn’t do that?</p><p>In order to create modern and interactive solutions today with Angular, we need to know the basics of HttpClient and HttpBackend.</p><h3>What is HttpClient</h3><p>So, what exactly is HttpClient and why do we need it at all? Why not use simple fetch to do the requests?</p><p>It is a built-in Angular service that does some work for us. It makes it easy to send HTTP requests to a server, handle the response and in simpler words — it’s a tool that helps us to communicate with the backend.</p><p>If we open the repository of Angular in GitHub we can see that the file is relatively big and has a bunch of stuff in there.</p><p>With HttpClient we get the following important methods — GET, POST, PUT and DELETE. Let’s check an example to illustrate what is going on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j4-scbVk-7SwqX2tDYnVBQ.png" /></figure><p>When we create an instance of HttpClient we can call the method “get” and pass two arguments — url and an object with some options. Some of them are self explanatory and I am not going to dive too much on them today, but I want to point out something!</p><p>Have a look at the <strong>responseType</strong>. Here it is defined as ‘blob’ and from that we get a response of Observable that contains a HttpEvent of type Blob.</p><p>Defining it is not required by default, but keep in mind if you are working with specific type of data.</p><p>Let’s look of this example:</p><p>I want to fetch some users and want my response to be of that type. How do I do it?</p><p>I can simply define the type of the request itself.</p><p>Check it out here</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0p1_rR_DYTFhg7fR66Zo-A.png" /></figure><p>Once the request has been returned, you can subscribe and work with it.</p><p>Important thing I want to share is under the hood Angular uses XHR. The XHR object is a built-in JavaScript object that allows us to send and receive HTTP requests.</p><h3>Why use HttpClient to make requests, when you can use fetch()</h3><p>Well.. this is open for a debate and some people actually prefer using the fetch(), rather than the HttpClient.</p><p>HttpClient handles a lot of details such as setting headers, encoding data and handling the cookies by default. It adds consistency to the codebase.</p><p>Another thing is that Angular is built around the idea of reactive paradigm. And HttpClient is no different. It returns an Observable as we saw in the code earlier.</p><ul><li>It also has some built in support for interceptors</li><li>it has some additional methods — such as HEAD, OPTIONS and PATCH</li><li>it supports working with non-JSON data format out of the box</li><li>customizable</li></ul><p>If using fetch() you have to add that abstraction yourself.</p><h3>What is HttpBackend</h3><p>Most people haven’t used it, some haven’t heard of it.</p><p>If we browse the src folder in the http folder in the official Angular repo we can see a file named “backend.ts”</p><p>What is that?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dNtf0vaP1lHgRpE0QuwxHw.png" /></figure><p>As we can see it is an abstract class. Simple interface that provides us with the only bare minimum of the HTTP client. No fancy features. No interceptors, no response mapping.</p><p>To use it, you have to create a new instance of HttpClient and pass an instance of HttpBackend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lQ-DcyxGKsqe3aYTU2nGsg.png" /></figure><p>It provides a low-level interface for sending HTTP requests and receiving responses and that alone could be useful in some cases where you need more control over the behavior of HTTP requests.</p><p>Some cases could be:</p><ul><li>getting the bare minimum and implementing custom HTTP behavior</li><li>improved performance and size, since a lot of the features are just missing</li><li>very specific custom and complex request</li></ul><p>That leads to manually handling eros and parsing your responses.</p><p>I have seen this implementation myself only once and most of the time you will know you need it.</p><p>In like 99% of cases.. you probably don’t.</p><p>I am interested — have you implemented it and in what conditions?</p><p><strong>Important note — when using the HttpBackend you must know that it bypass as of its nature the interceptor chain</strong></p><p>This could be useful if you need to create requests that you don’t want to go through the interceptors.</p><p>You won’t need to create some fancy solutions and handle conditionals logic.</p><p>Just create a service and do the requests you need through it!</p><h3>The Holy Observable</h3><p>Observables play an incredibly important role in working with HttpClient and HttpBackend in Angular.</p><p>As we saw, the request returns Observable of specific type.</p><p>I have written a little article on how I usually work with Observables and I am planning to go a lot deeper in the future and create some cheat sheets for all of us to use.</p><p>If that is something of your interest.. a follow would be nice.</p><h3>Conclusion</h3><p>So much to learn and so many different implementations and ideas.</p><p>Incredible framework with incredible power.</p><p>I absolutely love working with it and am eager to learn all the time.</p><p>HttpClient and HttpBackend are incredible tools that allow us to make complex and interactive applications.</p><p>All the features we get from HttpClient do a lot of the heavy work for us and implementing it is as easy as possible.</p><p>Thank you for your time and don’t forget to follow me for more!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=420213ba3a3d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I work with Observables in Angular]]></title>
            <link>https://medium.com/@dimitarg.stoev/how-i-work-with-observables-in-angular-f62ad60cf3fb?source=rss-f3e9f0377b09------2</link>
            <guid isPermaLink="false">https://medium.com/p/f62ad60cf3fb</guid>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[observables]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Dimitar Stoev]]></dc:creator>
            <pubDate>Sat, 15 Apr 2023 13:05:18 GMT</pubDate>
            <atom:updated>2023-04-15T13:05:18.520Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ksSZPZlg5NL-HFKMVZSthA.png" /></figure><h3>Introduction</h3><p>This is a subject that is intimidating for a lot of folks out there and I have heard people explain it’s just too hard. In the beginning when I first started learning Angular I was having the same feelings. Like… What the hell? Why do I even need this Observable thing?</p><p>I managed to love it now and I prefer to always go reactive and always consider using RxJS as my goto approach first.</p><p>But with great powers, you know the rest.</p><p>There are many ways to deal with a single problem and this approach is my preferable one.</p><p>In the next lines I am going to talk about how I like to work with Observables and how I prefer to handle data.</p><p>This is part of my Angular series and it would be great if you subscribe / follow. It shows me that these articles are actually helpful to someone.</p><h3>TL;DR</h3><p>Ok, what to expect from this? In this article I am going to talk about</p><ol><li>Observables and declaring them</li><li>Subscribing to them with Async pipe</li><li>Working on data with Pipes</li><li>Combining pipes in the HTML template</li><li>An working demo showing all of the above</li></ol><h3>What are Observables?</h3><p>An observable. Simply put — a producer of data, a pipe that is delivering information on a consumer. It produces the value and delivers it when asked to.</p><p>There are certain types of Observables. We have cold ones and hot ones. Streaming data when asked and streaming data regardless of potential subscribers respectfully.</p><p>The observable itself plays a very central part of the reactive programming that is used in the framework. It is used often to manage asynchronous data, HTTP requests for example, inputs, and custom logic.</p><p>The “Observable” interface that the class implements, defines a set of methods and properties that allow us to interact with the observable, subscribe to the emissions and handle any errors. It includes a completion event as well.</p><p>When we subscribe to an observable, it creates a new subscription object. This object is used to control and manage the interaction between the observable and the subscriber.</p><p>It is important to point out that unsubscribing is an important part of the working flow of working with Observables. Especially if we are talking about hot observables that are sending data regarding the user interaction.</p><p>The “async” pipe is doing this for now and it is my preferred way to deal with Observables.</p><p>Another thing that RxJS is providing us with is the ability to manipulate the data before passing it to the consumer. We have various operators to choose from that have different behaviors.</p><h3>Using Async pipe</h3><p>When it comes to my personal preferences I usually prefer to define the Observable in my class and use the async pipe in the template.</p><p>This is great, since it automatically does subscribing and unsubscribing to it. Getting the data is easy and handling it is easy as well.</p><p>Let’s get to the examples. We have a list of users and we want to iterate over it. Our task is to list the information to our user.</p><p>You can check the entire source code in the repo, but I am going to provide snippets here.</p><p>I usually create the services, the interfaces and then declare the observable with the correct type in the .ts file. Subscribing is done with the async pipe.</p><p>In this example I am getting the entire list of users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PWibw1a998Er6w05" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d3HaxY8DhpoHaFU1" /></figure><p>Angular is using the pipe and subscribes to this observable under the hood. The data is loaded and when delivered — rendered.</p><p>We are going to implement routing and loading single data usage. RxJS is going to help us here.</p><h3>Loading single user</h3><p>The moment a user is clicked in the &lt;li&gt; list we are using routerLink to change the route and load the data of the specific user. We will load status and description. Nothing more for our little demo, but I am going to highlight my approach on controlling the data there.</p><p>I am using ‘from’ operator here to convert my ‘USERS’ array to an observable stream and ‘find’ to return either the found user or an error using the ‘throwError’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oP0ijgklZnr4xaCY" /></figure><p>Many ways to handle the id of the route, but I am going to use something simple for this. I want to showcase the template and the combination with the *ngIf directive.</p><p>I am still using the onPush change detection and the user is an observable of User type. The control of the data is reactive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*roej8RoqlbZE1TjE" /></figure><p>Let’s say I want to list the active users. We have a property that sets their “status”. I would go with the following — since I already have the users, I could just pipe them again and filter it there.</p><p>Fast and clean!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Nam470n2YLZofRPV" /></figure><p>In the provided repo below, you can check a functionality that adds users, update the UI automatically on update using BehaviorSubject and Observable.</p><p>The template is rendered with an async pipe as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nySMt2Mgkdspor68" /></figure><h3>How to use Observables and Pipes together in Angular?</h3><p>I love pipes. I try to use them as much as possible. I know not every time is the best time to use them and sometimes it’s just not the case.</p><p>But let’s say you have a response and get that users. But you need to arrange the data in specific order.</p><p>What do you do?</p><p>I could do the job perfectly with a custom Pipe here. I get Users[] and return Users[].</p><p>Let’s see an example.</p><p>I am reworking the template in order to handle null users. Chaining pipes is just too great!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NFfoEXC2peei6SGR" /></figure><p>One thing I usually do as well is combine all these Observables into one. I am using combineLatest in this example to use it as a single variable in the template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*llhhGjeTk8sWuoUa" /></figure><p>The template:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SmToQtfMETds-ECn" /></figure><h3>Demo project</h3><p>The entire source code is in a repo on my GitHub profile. Every example here is there and you can check the interactions and the way it is structured.</p><p>Here is the link</p><p><a href="https://github.com/dimitar-stoev/observables-example">https://github.com/dimitar-stoev/observables-example</a></p><p>I am planning to expand this into a bigger demonstration project with design, functionality and some patterns and practices, so if you are interested in that — follow and “star” the project.</p><p>Thank you in advance!</p><h3>Conclusion</h3><p>I really love working with Observables, Subjects, BehaviourSubjects and pipes. When I start a feature, I always try to plan in advance and I try to plan as reactively and declaratively as possible.</p><p>In the project I listed above, I am planning to create a full application with best practices and every article I write for Angular is going to be referred to and implemented in the project ( whenever is possible of course ).</p><p>Thank you and good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f62ad60cf3fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My take on how to pass a technical interview]]></title>
            <link>https://medium.com/@dimitarg.stoev/introduction-1bd6fd11081c?source=rss-f3e9f0377b09------2</link>
            <guid isPermaLink="false">https://medium.com/p/1bd6fd11081c</guid>
            <category><![CDATA[interview-tips]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Dimitar Stoev]]></dc:creator>
            <pubDate>Sun, 02 Apr 2023 10:10:38 GMT</pubDate>
            <atom:updated>2023-05-27T06:18:26.736Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IIUJxN_4HcfUFt1VWtbO6A.jpeg" /></figure><p>I know it’s scary to a lot of people, but knowing how to pass an interview is a skill on its own. While technical skills and experience are certainly important, there are many other factors that can influence a hiring decision.</p><p>Soft skills can make a significant difference in how well you can perform in a tech interview and can lead to a better result. Communication, attitude and personality could be crucial.</p><p>By the end of the post, you will have a better understanding of how to approach a tech interview and increase your chances of success. This strategy works both for junior developers and more advanced ones.</p><h3>To whom do I write this article?</h3><p>I want to make one thing clear before I continue with the article. This article IS NOT for someone who is just trying to get into tech for money or for someone who just wants to “cheat” the system.</p><p>This article is for people who are passionate about their work and love what they do, but have some problems managing their interviews.</p><p>This article is for people who don’t just want to be programmers, but want to get further ahead.</p><p>These tips could be used not only for passing an interview, but also to expand your knowledge and improve yourself.</p><p>Ok, so let’s get it all started.</p><h3>Why do soft skills matter?</h3><p>If you try to compare yourself to other programmers, you will usually find several other people that are WAY smarter and better than you. And that’s absolutely fine! To be in the 1% of top programmers is something that most of us probably don’t even want.</p><p>When you apply for a job, you can’t just expect and hope that someone will notice your CV. At some companies, most CVs don’t even get to HR. There is an algorithm that makes the initial decisions. If you pass that phase, there is a good chance your CV is going to be compared to the best candidates for the job.</p><p>How would I fight that? Are you going to leave it all to chance?</p><p>You know soft skills are important, but how to show them if you are not even picked for an interview?</p><h3>Be prepared and organized</h3><p>Let’s start with the more trivial information. Research the companies you are applying to.</p><p>I have always been against the idea of mass spam and apply to every single job out there. If you are looking for specific positions, try to search for the right position, not just every open one.</p><p>There are way too many companies out there and you need to take your time to find the right one. Pick just a few. Below ten is perfect in my opinion.</p><p>When you do that, check everything possible about them, find the people who take the decisions on social media, learn what they think about topics that are interesting to you and so on.</p><p>Try to feel the culture.</p><p>Engage!</p><p>Engage with them, talk to them and prepare a cover letter individually for every single company. Don’t copy and paste. Be serious about it!</p><p>You are not spamming companies, you are looking for the best place possible for you. You want to be happy at that company and working with like minded people. That’s how you are going to be productive and you will enjoy working.</p><h3>Communicate clearly and confidently</h3><p>This is a hard one, since it takes the most time. It’s not something that you can change in a day, but it is something that will improve every area of your life.</p><p>When you engage with people on social media or recruiters, you need to show that you are a professional and bring real value. People have to know you are capable of taking decisions and sticking by them.</p><p>Show that you have an opinion on topics, even if they are controversial. I would avoid politics tho..</p><p>If you engage with the right people and when you start to promote yourself, they would already know you. That’s something other candidates won’t have.</p><p>It’s always better to hire a professional you know, than to expect to find a good match out of the blue.</p><h3>Showcase your knowledge</h3><p>Okay, I will lose some readers, but writing is the best way to get a job. And not only tech jobs, but any job.</p><p>I am new to writing and I even get some offers out of thin air because of it. I occasionally write articles about Angular and people expect me to know Angular, even before talking to me at all. That’s a power out there!</p><p>It doesn’t matter the field you are in. It’s not just tech. It has applications in a variety of fields. If you know something — share it. You accomplish two important things that way:</p><ul><li><strong>You show your domain and when people engage with you, you don’t need to prove anything. They already know you know. You are shifting the interview and the conversation from “Does this guy know about it?” to “Okay, he is a professional, let’s see if the personality can match the culture”<br> The hardest part is already behind you!</strong></li><li><strong>You help people that start today! I believe this is also important. You face challenges that a lot of other people are facing as well. Help as many people as you can. <br>The fulfillment is great!</strong></li></ul><p>Let’s summarize. Demonstrating the softs skills you have before applying even for the job is bringing you so much value, it’s unbelievable. Too many people are not playing the bigger game and if you start now — you are way ahead already!</p><h3>Demonstrate your technical skills</h3><p>This is where most of the stuff can go very wrong! Getting here is not a small task and I can argue for a long time that soft skills are important as much as technical ones. But a lot of people assume that the technical part of the interview is .. well.. only technical.</p><p>This part of the interview needs the best of your soft skills!</p><p>Let’s take two examples</p><h3>Example one: The experience</h3><p>We have this guy who has a ton of experience. Almost ten years, working as a back end engineer. He usually gets the job done fine, nothing fancy, nothing great. He is developing his technical abilities, but doesn’t give a dime for his social and soft skills.</p><p>Working like that leads to bad companies and people don’t like to work with him too much. He is not very sharing either.</p><p>When he goes to interviews, he smashes the technical one, but he ends up all the time at bad companies. That leads him to being average and he starts to show signs of “not caring” enough. Why is that?</p><p>I believe it’s an easy answer. Soft skills are skills that could be learned and it’s not just “that’s the way I am, take it or leave it”. Well.. most people won’t take it.</p><p>Don’t just assume you got the job, only because you know a lot. Many people do. It’s not enough even in this demanding market. Great companies want great people.</p><h3>Example two: The great character</h3><p>A person with around three years of experience, but with great soft skills. He always tries to teach somebody, and share knowledge all the way. Demand from himself.</p><p>He always expects more from himself and this leads to better communication. He is not writing articles, but he is always talking to people. He is engaging in network events and even led some small conferences in his hometown.</p><p>He is the guy that works around half the day and the other half is helping people. Great personality.</p><p>Who do you think is more respected and has the better job?</p><p>Easy answer, I know.</p><h3>The interview</h3><p>When you get to that part, show your passion for the technology. You have written articles, you have talked to people, you have managed to understand the language.</p><p>Show that!</p><p>Don’t just answer questions. When they ask you about something, expand it, talk with understanding.</p><p>And question back!</p><p>Ask questions about how they use the technology they ask you about. Ask questions about implementation and architecture in the project they have. Show the interest you have gained while developing the company beforehand.</p><p>Try to understand where you are going before even opening and cloning the repository. Act as you are part of the team already.</p><p>Those interviewers are real people who have the same passion ( most of the time ) as you. Engage in conversation and not just Q&amp;A.</p><p>When they ask you what you would do in a particular situation, ask them back. They have that question for a reason. Learn how they did it and why. Be curious.</p><p>Your attitude should change from “he is above me and I have to prove myself worth it” to “We are both technology lovers and I want to make sure I am getting in the right company”.</p><p>No better way to do that than to ask the right questions.</p><h3>Additional tips</h3><p>Some of this will cost money, but the harsh reality is that no matter what some fake gurus are telling you. You can’t make it all for free.</p><p>Let’s make it in a bullet points</p><ul><li><strong>website — make it your own and share to other platforms</strong></li><li><strong>professional email — don’t use your Gmail account. It’s not serious</strong></li><li><strong>github account — take some time to make it look good</strong></li><li><strong>professional image for your social media accounts — use one for all</strong></li><li><strong>share and network offline as well — a lot of good offers come by by people you know in real life</strong></li></ul><p>Follow up after the interview. Don’t forget to follow up if time passes by.</p><p>You need to know what happened and feedback is important to you. Be serious about it.</p><h3>Summarizer</h3><p>Passing an interview it’s a skill. You will manage after passing a few with no problem. You can learn the asked questions and pass every single one of them.</p><p>But doing that is a game of chance and luck. I don’t believe in that way of doing “life”. You need to take control of your own life and career.</p><p>Advance your soft skills, advance your writing skills and talk to people A LOT. Engage as much as possible. Show yourself to the world.</p><p>Be the picker. You choose the companies that you work for. Not chance.</p><p>It takes a lot of time, but it’s worth it.</p><p>Good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1bd6fd11081c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>