<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ideario</title>
    <description>Blog personal de Luis Reinoso</description>
    <link>https://luisreinoso.dev/</link>
    <atom:link href="https://luisreinoso.dev/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Mon, 10 Feb 2025 09:56:27 -0500</pubDate>
    <lastBuildDate>Mon, 10 Feb 2025 09:56:27 -0500</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>Cómo utilizar MCP Server con Supabase y Cursor</title>
        <description>&lt;h2 id=&quot;introducción&quot;&gt;Introducción&lt;/h2&gt;

&lt;p&gt;MCP Server es un protocolo open source para conectar diversas plataformas para alimentar un modelo largo de lenguaje.&lt;/p&gt;

&lt;p&gt;En este caso, vamos a utilizar Supabase como base de datos y Cursor para usarlo en Composer, sea en modo agente o normal.&lt;/p&gt;

&lt;h2 id=&quot;instalación&quot;&gt;Instalación&lt;/h2&gt;

&lt;p&gt;Para ellos vamos a clonar el repositorio de &lt;a href=&quot;https://github.com/modelcontextprotocol/servers&quot;&gt;MCP Server&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone git@github.com:modelcontextprotocol/servers.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Ir a la carpeta de supabase.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;servers/postgres/src/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Instalar las dependencias.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pnpm &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Construir el proyecto.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pnpm build
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;instalación-en-cursor&quot;&gt;Instalación en Cursor&lt;/h2&gt;

&lt;p&gt;Para ello vamos a Cursor donde puedes agregar un MCP server de la siguiente manera.&lt;/p&gt;

&lt;p&gt;Copia el path hasta el archivo &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;index.js&lt;/code&gt; del MCP Server que acabamos de construir.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/Users/juanpablonunez/Documents/modelcontextprotocol/servers/postgres/src/index.js
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Ve a la configuración de Cursor &amp;gt; Features &amp;gt; MCP Server&lt;/p&gt;

&lt;p&gt;Click en “add new MCP server”&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/static/img/posts/add-new-mcp-server.png&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Selecciona el tipo de servidor “command”
Agrega el nombre de descriptivo
Y finalmente agrega el path del archivo &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;index.js&lt;/code&gt; del MCP Server que acabamos de construir.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/static/img/posts/edit-mcp-server.png&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Este es el resultado si todo salió bien.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/static/img/posts/mcp-server-cursor-installed.png&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;ejecución&quot;&gt;Ejecución&lt;/h2&gt;

&lt;p&gt;Para usarlo vas a composer y pide que te haga una búsqueda en la base de datos.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/static/img/posts/mcp-server-execution.png&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;conclusiones&quot;&gt;Conclusiones&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Es una herramienta muy poderosa para conectar diversas plataformas para alimentar un modelo largo de lenguaje.&lt;/li&gt;
  &lt;li&gt;Es muy fácil de instalar y usar.&lt;/li&gt;
  &lt;li&gt;Es una herramienta que se puede usar en modo agente o normal.&lt;/li&gt;
  &lt;li&gt;Se puede conectar cualquier sistema creando nuestros propios MCP Server.&lt;/li&gt;
  &lt;li&gt;En este proyecto usamos Supabase como base de datos, pero se puede conectar cualquier base de datos PostgreSQL con este ejemplo.&lt;/li&gt;
  &lt;li&gt;Aquí estamos trabajando con un proyecto localmente, por eso el query string está con el usuario y contraseña de Supabase local de la base de datos.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;referencias&quot;&gt;Referencias&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/modelcontextprotocol/servers&quot;&gt;MCP Server&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.cursor.com/advanced/model-context-protocol&quot;&gt;Cursor - MCP Server Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
        <pubDate>Fri, 09 Feb 2024 19:46:00 -0500</pubDate>
        <link>https://luisreinoso.dev/how-to-use-mcp-server-supabase/</link>
        <guid isPermaLink="true">https://luisreinoso.dev/how-to-use-mcp-server-supabase/</guid>
        
        <category>mcp-server</category>
        
        <category>supabase</category>
        
        <category>cursor</category>
        
        <category>composer</category>
        
        <category>agente</category>
        
        <category>normal</category>
        
        <category>query string</category>
        
        <category>postgres</category>
        
        <category>mcp server</category>
        
        
        <category>mcp-server</category>
        
        <category>supabase</category>
        
        <category>cursor</category>
        
        <category>composer</category>
        
        <category>agente</category>
        
        <category>normal</category>
        
        <category>query string</category>
        
        <category>postgres</category>
        
        <category>mcp server</category>
        
      </item>
    
      <item>
        <title>Como utilizar pnpm con Angular</title>
        <description>&lt;h2 id=&quot;introducción&quot;&gt;Introducción&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pnpm&lt;/code&gt; es un gestor de paquetes de javascript el cual una de sus mejores ventajas &lt;strong&gt;es reducir el tiempo de instalación de las dependencias&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&quot;instalación-de-pnpm&quot;&gt;Instalación de pnpm&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm install -g pnpm&lt;/code&gt;&lt;/p&gt;

&lt;h2 id=&quot;configuración-con-angular&quot;&gt;Configuración con angular&lt;/h2&gt;

&lt;h3 id=&quot;proyecto-nuevo&quot;&gt;Proyecto nuevo&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Utilizar el angular CLI con pnpm para crear un nuevo proyecto
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pnpm --package=@angular/cli dlx ng new amazing-project --package-manager pnpm&lt;/code&gt;\&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;El angular CLI nos preguntara las opciones de configuración y finalmente instala el proyecto
&lt;img src=&quot;/uploads/Install%20Angular%20with%20pnpm.png&quot; alt=&quot;Install Angular with pnpm.png&quot; /&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Al abrir el proyecto podemos ver el archivo &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pnpm-lock.yaml&lt;/code&gt;
&lt;img src=&quot;/uploads/pnpm-lock-file.png&quot; alt=&quot;pnpm-lock-file.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;proyecto-existente-con-npm&quot;&gt;Proyecto existente con npm&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Ejecuta el comando de &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pnpm install&lt;/code&gt; y automáticamente creara el archivo &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pnpm-lock.yaml&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Luego de eso borrar el archivo &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;package-lock.json&lt;/code&gt;
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rm package-lock.json&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Ejecutar &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pnpm start&lt;/code&gt; para confirmar que todo funciona correctamente&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;En caso de que el proyecto no funcione hay la opción de instalar las dependencias respetando las diferentes versiones requeridas por los paquetes mediante
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pnpm install --shamefully-hoist=true&lt;/code&gt;&lt;/p&gt;

&lt;h3 id=&quot;comparando-la-instalación-de-pnpm-y-npm-en-un-proyecto-nuevo&quot;&gt;Comparando la instalación de pnpm y npm en un proyecto nuevo&lt;/h3&gt;

&lt;p&gt;Considerando:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;hemos instalado por primera vez el proyecto utilizando npm y pnpm.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;existen los archivos &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;package-lock.json&lt;/code&gt; y &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pnpm-lock.yaml&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;la carpeta node_modules no se encuentra en el proyecto&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;instalación-con-npm&quot;&gt;Instalación con npm&lt;/h4&gt;

&lt;p&gt;Duración: 14 segundos
&lt;img src=&quot;/uploads/npm%20install.gif&quot; alt=&quot;npm install.gif&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;instalación-con-pnpm&quot;&gt;Instalación con pnpm&lt;/h4&gt;

&lt;p&gt;Duración: 2.2 segundos
&lt;img src=&quot;/uploads/pnpm%20install.gif&quot; alt=&quot;pnpm install.gif&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;por-qué-pnpm-es-mas-rápido&quot;&gt;Por qué pnpm es mas rápido?&lt;/h2&gt;

&lt;p&gt;Debido a que pnpm almacena las dependencias en un solo sitio y crea enlaces simbólicos a la carpeta node_modules según se necesite, de esta forma evitar descargar los paquetes y reutiliza los preexistentes en la computadora.&lt;/p&gt;

&lt;h2 id=&quot;conclusiones&quot;&gt;Conclusiones&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;La instalación de un proyecto es definitivamente mas rápido con pnpm que con npm&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;La experiencia de desarrollo mejora al esperar menos tiempo en instalar las dependencias&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Reducir el tiempo de instalación también reduce el costo por servicios de CI/CD&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;referencias&quot;&gt;Referencias&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://pnpm.io/motivation#saving-disk-space-and-boosting-installation-speed&quot;&gt;pnpm motivation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://pnpm.io/npmrc#shamefully-hoist&quot;&gt;pnpm shamefully-hoist&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://pnpm.io/cli/install&quot;&gt;pnpm install&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Thu, 09 Mar 2023 19:46:00 -0500</pubDate>
        <link>https://luisreinoso.dev/how-to-use-angular/</link>
        <guid isPermaLink="true">https://luisreinoso.dev/how-to-use-angular/</guid>
        
        <category>pnpm</category>
        
        <category>npm</category>
        
        <category>JavaScript</category>
        
        <category>package manager</category>
        
        <category>dependency installation</category>
        
        <category>disk space</category>
        
        <category>development experience</category>
        
        <category>CI/CD</category>
        
        <category>installation speed</category>
        
        <category>symbolic links</category>
        
        <category>configuration options</category>
        
        <category>Angular CLI</category>
        
        <category>pnpm-lock.yaml</category>
        
        <category>package-lock.json</category>
        
        <category>shamefully-hoist</category>
        
        
        <category>angular</category>
        
        <category>javascript</category>
        
      </item>
    
      <item>
        <title>Como usar images en Chat GPT</title>
        <description>&lt;h2 id=&quot;explicacion&quot;&gt;Explicacion&lt;/h2&gt;

&lt;p&gt;Para utilizar imagenes en ChatGPT utilizaremos la sintaxis de Markdown ya que esta puede mostrar una imagen desde una URL&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;![DESCRIPTION](IMAGE_URL)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Aprovechando esta funcionalidad utilizaremos la &lt;a href=&quot;https://unsplash.com/developers&quot;&gt;API de unplash&lt;/a&gt; para generar imagenes dado un texto.&lt;/p&gt;

&lt;p&gt;Especificamente esta URL donde podemos obtener una imagen basado en el texto &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;https://source.unsplash.com/400x400/?[texto a reemplazar]&lt;/code&gt;&lt;/p&gt;

&lt;h2 id=&quot;ejemplo&quot;&gt;Ejemplo&lt;/h2&gt;

&lt;p&gt;Para demostrar este metodo se creara un juego de adivinar el animal, el ChatGpt nos dara una serie de pistas sobre el animal que debemos adivinar, y nosotros responder con el nombre del animal.&lt;/p&gt;

&lt;p&gt;El prompt a ser utilizado sera:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Actua como un juego interactivo para adivinar un animal, dame una pista a la vez, espera por mi respuesta para continuar con la siguiente pista, cuando adivine el animal devuelve un mensaje de &quot;Felicitaciones&quot; ![FotoAnimal](https://source.unsplash.com/800x400/?[animal]) reemplaza [animal] con el nombre del animal adivinado en ingles
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;Actua como un juego interactivo para adivinar un animal, dame una pista a la vez, espera por mi respuesta para continuar con la siguiente pista, cuando adivine el animal devuelve un mensaje de “Felicitaciones” &lt;img src=&quot;https://source.unsplash.com/800x400/?[animal]&quot; alt=&quot;FotoAnimal&quot; /&gt; reemplaza [animal] con el nombre del animal adivinado en ingles&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&quot;/static/img/posts/adivina_animal_inicio.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Una vez adivinado el resultado se puede observar la imagen&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/static/img/posts/adivina_animal_fin.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
</description>
        <pubDate>Mon, 27 Feb 2023 19:00:00 -0500</pubDate>
        <link>https://luisreinoso.dev/chat%20gpt/prompt%20engineering/2023/02/27/como-usar-imagenes-en-chat-gpt.html</link>
        <guid isPermaLink="true">https://luisreinoso.dev/chat%20gpt/prompt%20engineering/2023/02/27/como-usar-imagenes-en-chat-gpt.html</guid>
        
        <category>chat GPT</category>
        
        <category>openAI</category>
        
        
        <category>chat GPT</category>
        
        <category>prompt engineering</category>
        
      </item>
    
      <item>
        <title>Que es storybook y como utilizarlo en Angular?</title>
        <description>&lt;p&gt;Storybook es un entorno de desarrollo para construir componentes de interfaz de usuario. Te permite desarrollar tus componentes de forma aislada, lo que significa que &lt;strong&gt;no tienes que preocuparte por el resto de tu aplicación cuando trabajas en un componente específico&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Aqui una visión general de cómo utilizar Storybook en Angular.&lt;/p&gt;

&lt;h2 id=&quot;instalacion&quot;&gt;Instalacion&lt;/h2&gt;

&lt;p&gt;La forma más rápida es ejecutando el siguiente comando
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npx storybook init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Y agregando al &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;angular.json&lt;/code&gt; en la section de architect&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;{
  ...
  &quot;architect&quot;: {
    ...
    &quot;storybook&quot;: {
      &quot;builder&quot;: &quot;@storybook/angular:start-storybook&quot;,
      &quot;options&quot;: {
        &quot;browserTarget&quot;: &quot;angular-cli:build&quot;,
        &quot;port&quot;: 6006
      }
    },
    &quot;build-storybook&quot;: {
      &quot;builder&quot;: &quot;@storybook/angular:build-storybook&quot;,
      &quot;options&quot;: {
        &quot;browserTarget&quot;: &quot;angular-cli:build&quot;
      }
    }
  }
}

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;convirtiendo-tu-componente-en-una-historia&quot;&gt;Convirtiendo tu componente en una historia&lt;/h2&gt;

&lt;p&gt;Lo primero que tienes que hacer es crear un nuevo archivo llamado &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;header.stories.ts&lt;/code&gt; en la carpeta del componente que deseas realizar.&lt;/p&gt;

&lt;p&gt;Una vez hecho esto, puedes importar tu componente en el archivo y luego escribir tu historia. Una historia es simplemente una función que devuelve el componente sobre el cual quieres trabajar. Por ejemplo, si quisiéramos trabajar en un componente header, nuestra historia podría ser así&lt;/p&gt;

&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;moduleMetadata&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;@storybook/angular&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;HeaderComponent&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;./header.component&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Story&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Meta&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;@storybook/angular/types-6-0&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Layout/Header&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;HeaderComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Meta&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Template&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Story&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;HeaderComponent&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;HeaderComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;HeaderComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;props&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;header&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Template&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({});&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;args&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;creación-de-múltiples-historias-para-un-componente&quot;&gt;Creación de múltiples historias para un componente&lt;/h2&gt;

&lt;p&gt;A menudo resulta útil &lt;strong&gt;crear varias historias para un mismo componente&lt;/strong&gt;, de modo que pueda ver cómo se comporta en diferentes situaciones. Por ejemplo, es posible que desee probar el header con un diferentes textos.&lt;/p&gt;

&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;headerWithText&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Template&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({});&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;args&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;today&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;27-03-2021&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;headerWithoutText&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Template&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({});&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;args&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;today&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Cada argumento permitido dentro del &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;args&lt;/code&gt; es parte un input dentro del componente&lt;/p&gt;

&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Component&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ChangeDetectionStrategy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Input&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;@angular/core&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;Component&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;app-header&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;templateUrl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;./header.component.html&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;styleUrls&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;./header.component.scss&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;changeDetection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ChangeDetectionStrategy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;OnPush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;HeaderComponent&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;Input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;today&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;De esta forma podemos ver como se comporta el header en con diferentes textos&lt;/p&gt;

&lt;h2 id=&quot;conclusiones&quot;&gt;Conclusiones&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Desarrollar componentes de forma aislada sin preocuparte de la aplicación&lt;/li&gt;
  &lt;li&gt;Probar componentes en diferentes estados (por ejemplo, con diferentes datos)&lt;/li&gt;
  &lt;li&gt;Ver cómo se comporta los componentes en diferentes navegadores y tamaños de pantalla&lt;/li&gt;
  &lt;li&gt;Documentar componentes para que otros desarrolladores entiendan fácilmente cómo utilizarlo&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;enlaces&quot;&gt;Enlaces&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://storybook.js.org/docs/guides/guide-angular/&quot;&gt;Storybook - Angular guide&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.learnstorybook.com/intro-to-storybook/angular/en/get-started/&quot;&gt;Intro to storybook&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Tue, 07 Feb 2023 19:00:00 -0500</pubDate>
        <link>https://luisreinoso.dev/angular/2023/02/07/que-es-storybook-y-como-utilizarlo-en-Angular.html</link>
        <guid isPermaLink="true">https://luisreinoso.dev/angular/2023/02/07/que-es-storybook-y-como-utilizarlo-en-Angular.html</guid>
        
        <category>angular</category>
        
        
        <category>angular</category>
        
      </item>
    
      <item>
        <title>How to create an APK from PWA?</title>
        <description>&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Has PWA all ready &lt;strong&gt;Important!&lt;/strong&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install llama pack dependencies&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://adoptopenjdk.net/releases.html?variant=openjdk8&amp;amp;jvmVariant=hotspot&quot;&gt;OpenJDK 8&lt;/a&gt;
Download and uncompress it on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.java/&lt;/code&gt; directory&lt;/p&gt;

    &lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;tar xf ./openJDK-jdk.tar.gz -C ~/.java/
tar xf ./openJDK-jre.tar.gz -C ~/.java/
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;

    &lt;p&gt;&lt;strong&gt;Optional&lt;/strong&gt;
Setup enviroment variable.&lt;/p&gt;

    &lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;echo &quot;export JAVA_HOME=\&quot;/home/luis/.java/OpenJDK8U-jdk_xxx/jdk8u242-xxx\&quot; &amp;gt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; ~/.bashrc&lt;span class=&quot;s2&quot;&gt;&quot;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;

    &lt;p&gt;Close all terminals for changes to take effect&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://developer.android.com/studio#command-tools&quot;&gt;Android command line tools&lt;/a&gt;
Search section command line tools only
Download and uncompress it on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/Android/sdk/&lt;/code&gt;&lt;/p&gt;

    &lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;unzip ./commandlinetools-linux-xxxx_latest.zip -d ~/Android/sdk/
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install llama-pack cli&lt;/p&gt;

    &lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;npm i -g @llama-pack/cli
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;execute-llama-pack&quot;&gt;Execute llama-pack&lt;/h2&gt;

&lt;p&gt;Provide &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;manifest.json&lt;/code&gt; url or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;manifest.webmanifest&lt;/code&gt; file&lt;/p&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;llama-pack init --manifest https://my-twa.com/manifest.webmanifest
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Answer questions about twa&lt;/p&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;Domain being opened in the TWA:
Name of the application:
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In keystore let’s press enter then it asks you about create a key store&lt;/p&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;First and Last names (eg: John Doe): Luis Reinoso
Organizational Unit (eg: Engineering Dept): Developer
Organization (eg: Company Name): Freenlance
Country (2 letter code): EC
// use the same password
Password for the Key Store: [hidden]
Password for the Key: [hidden]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Upload private key to google play console&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Create asset link
Using package fingerprint (SHA256) inside app sign go to &lt;a href=&quot;https://developers.google.com/digital-asset-links/tools/generator&quot;&gt;Google Digital Asset Links&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;You will need the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;App package fingerprint (SHA256)&lt;/code&gt;, to get it search for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;API Integrity&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;App Signing&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This will create a json then create a file named &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;assetlinks.json&lt;/code&gt; and serve it from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;https://my-twa.com/.well-known/assetlinks.json.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Useful Checker
https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://www.your-website-name.com&amp;amp;relation=delegate_permission/common.handle_all_urls&lt;/p&gt;

&lt;h2 id=&quot;build-apk&quot;&gt;Build apk&lt;/h2&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;llama-pack build
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This generate the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;app-release-signed.apk&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Upload to play store&lt;/li&gt;
  &lt;li&gt;Fill all data required from play store&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;references&quot;&gt;References&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/GoogleChromeLabs/llama-pack/tree/master/packages/cli&quot;&gt;llama pack cli&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Sat, 20 Jun 2020 19:00:00 -0500</pubDate>
        <link>https://luisreinoso.dev/pwa/2020/06/20/how-to-create-APK-from-PWA.html</link>
        <guid isPermaLink="true">https://luisreinoso.dev/pwa/2020/06/20/how-to-create-APK-from-PWA.html</guid>
        
        <category>PWA</category>
        
        
        <category>PWA</category>
        
      </item>
    
      <item>
        <title>Angular storybook cheatsheet</title>
        <description>&lt;h2 id=&quot;installation&quot;&gt;Installation&lt;/h2&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;npm install -g @storybook/cli
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Go to angular project then execute&lt;/p&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;sb init
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Remove angular stories examples&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;create-a-new-story&quot;&gt;Create a new story.&lt;/h2&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;  ng g component test
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;create-story-file&quot;&gt;Create story file&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;test.stories.ts&lt;/code&gt; It should have stories before &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ts&lt;/code&gt; extension&lt;/p&gt;

&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Ideario Components&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;IdearioComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;decorators&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;moduleMetadata&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// imports&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;imports&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;CommonModule&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;add-module-decorator&quot;&gt;Add module decorator&lt;/h2&gt;

&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;test&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;TestComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;...,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;moduleMetadata&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;imports&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[],&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;declarations&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[],&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;providers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;add-props-inputsoutputs&quot;&gt;Add props (inputs/outputs)&lt;/h2&gt;
&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;buttonWithProps&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Button&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;props&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;onClick&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;click this button&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2 id=&quot;add-ng-content&quot;&gt;Add ng-content&lt;/h2&gt;
&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;withContent&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Button&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;template&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;`
  &amp;lt;ideario-button&amp;gt;
    &amp;lt;span&amp;gt;Super text&amp;lt;/span&amp;gt;
  &amp;lt;/ideario-button&amp;gt;
  `&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;moduleMetadata&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;declarations&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;IdearioButtonComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2 id=&quot;fixing-commons--errors&quot;&gt;Fixing commons  errors&lt;/h2&gt;
&lt;p&gt;On &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.storybook&lt;/code&gt; folder&lt;/p&gt;

&lt;h4 id=&quot;100-height&quot;&gt;100% height&lt;/h4&gt;
&lt;p&gt;Add to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;preview-body.html&lt;/code&gt; file&lt;/p&gt;

&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nf&quot;&gt;#root&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;on-ionic&quot;&gt;On Ionic&lt;/h3&gt;
&lt;h4 id=&quot;page-on-blank&quot;&gt;Page on blank&lt;/h4&gt;
&lt;p&gt;https://github.com/storybookjs/storybook/issues/7703&lt;/p&gt;

&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:not&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.hydrated&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;block&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;no-render-components&quot;&gt;No render components&lt;/h4&gt;

&lt;p&gt;Add to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;preview-head.html&lt;/code&gt; file&lt;/p&gt;
&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;nomodule=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;https://unpkg.com/@ionic/core@latest/dist/ionic/ionic.js&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Thu, 11 Jun 2020 19:00:00 -0500</pubDate>
        <link>https://luisreinoso.dev/angular/2020/06/11/angular-storybook-cheatsheet.html</link>
        <guid isPermaLink="true">https://luisreinoso.dev/angular/2020/06/11/angular-storybook-cheatsheet.html</guid>
        
        <category>angular</category>
        
        
        <category>angular</category>
        
      </item>
    
      <item>
        <title>5 pasos para conseguir trabajo remoto como developer desde Ecuador sin ser programador Senior</title>
        <description>&lt;h2 id=&quot;crea-proyectos-de-software-libre-en-github&quot;&gt;Crea proyectos de software libre en Github.&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;¿Qué hacer?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Crear proyectos que te apasionen y empieza ya.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Razones&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Aprendizaje sobre trabajo colaborativo.&lt;/li&gt;
  &lt;li&gt;Puedes solicitar code reviews. (ver bonus al final del post)&lt;/li&gt;
  &lt;li&gt;Se observa fácilmente cómo organizas tu código.&lt;/li&gt;
  &lt;li&gt;Facilidad para compartir código&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;alimenta-tu-github&quot;&gt;Alimenta tu github.&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;¿Qué hacer?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Participar activamente en github. Puedes dar estrellitas, hacer un fork, leer código de otros, personalizarlo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Razones&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Github es el portfolio mainstream para un programador.&lt;/li&gt;
  &lt;li&gt;Aprendes sobre la marcha con código de otros.&lt;/li&gt;
  &lt;li&gt;Descubres nuevas librerías/funcionalidades.&lt;/li&gt;
  &lt;li&gt;Aprendes a buscar issues de tus librerías/frameworks favoritos.&lt;/li&gt;
  &lt;li&gt;Encuentras inspiración.&lt;/li&gt;
  &lt;li&gt;Personalizar funciones de programas para facilitarte la vida.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;practica-inglés&quot;&gt;Practica inglés.&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Qué hacer?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Inscríbete en un curso de ingles.&lt;/li&gt;
  &lt;li&gt;Usa una app de repetición espaciada. (anki, memrise).&lt;/li&gt;
  &lt;li&gt;Practíca con tu pareja.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Razones&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Aumentas la probabilidad de:
    &lt;ul&gt;
      &lt;li&gt;Obtener un trabajo excelentemente remunerado.&lt;/li&gt;
      &lt;li&gt;Obtener un trabajo en otras latitudes del planeta.&lt;/li&gt;
      &lt;li&gt;Obtener un trabajo donde eres parte de un equipo.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;un-cv-minimalista&quot;&gt;Un cv minimalista.&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Qué hacer?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Un CV sin:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Sin foto.&lt;/li&gt;
  &lt;li&gt;Datos muy personales.&lt;/li&gt;
  &lt;li&gt;Gráficos poniendo en porcentajes tus habilidades.&lt;/li&gt;
  &lt;li&gt;Historial académico a menos que sea relevante.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Un CV con:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Máximo una hoja&lt;/li&gt;
  &lt;li&gt;Los logros de los proyectos que hiciste en github o por trabajo.&lt;/li&gt;
  &lt;li&gt;Las descargas de las librerías que has hecho.&lt;/li&gt;
  &lt;li&gt;Breve listado de tecnologías que sabes (no importa si piensas que no sabes mucho, pon lo que usaste para hacer los proyectos en github!)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Razones&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Debe ser fácil de leer de un solo vistazo tu CV.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;aplica-al-empleo-que-deseas&quot;&gt;Aplica al empleo que deseas.&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Qué hacer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Aquí hay dos formas:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Al azar: Por medio de búsquedas (menos probable)&lt;/li&gt;
  &lt;li&gt;Empresa objetivo: Una empresa donde te gustaría trabajar (más probable)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;al-azar&quot;&gt;Al azar&lt;/h3&gt;

&lt;p&gt;Busca en google la tecnología que te guste seguido de la palabra jobs &lt;em&gt;inserte aquí_su_tecnología&lt;/em&gt; jobs&lt;/p&gt;

&lt;p&gt;Ejemplo:
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Angular jobs&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Encontraras muchos portales y aplica.&lt;/p&gt;

&lt;h3 id=&quot;empresa-objetivo&quot;&gt;Empresa objetivo&lt;/h3&gt;

&lt;p&gt;Ve la página principal de la empresa y busca la sección de &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;careers&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;cuenta-tu-historia-en-la-entrevista&quot;&gt;Cuenta tu historia en la entrevista.&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Qué hacer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Antes/Durante/Después de la parte técnica.&lt;/p&gt;

&lt;p&gt;Cuenta sobre tu historia en la programación y sobre que tuviste que pasar para llegar a ese momento. Para eso ya tienes los proyectos que hiciste en github.&lt;/p&gt;

&lt;h2 id=&quot;bonus&quot;&gt;Bonus&lt;/h2&gt;

&lt;p&gt;Si deseas conseguir un empleo con Angular pero tienes alguna duda técnica con respecto a hacer alguna cosa en Angular.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Puedo ayudar para que encuentres la solución al problema técnico.&lt;/li&gt;
  &lt;li&gt;Puedo hacer code review de tu proyecto en github.&lt;/li&gt;
  &lt;li&gt;Podemos hacer pair programming remotamente.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Solo mándame un mensaje :wink:&lt;/p&gt;
</description>
        <pubDate>Thu, 28 May 2020 19:00:00 -0500</pubDate>
        <link>https://luisreinoso.dev/blog/2020/05/28/5-pasos-para-conseguir-trabajo-remoto-como-developer-sin-ser-senior.html</link>
        <guid isPermaLink="true">https://luisreinoso.dev/blog/2020/05/28/5-pasos-para-conseguir-trabajo-remoto-como-developer-sin-ser-senior.html</guid>
        
        <category>blog</category>
        
        
        <category>blog</category>
        
      </item>
    
      <item>
        <title>Cómo navegar rápidamente entre archivos de proyectos de Angular en VSCode.</title>
        <description>&lt;p&gt;En base a mi experiencia esto depende de dos factores:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;la estructura del proyecto.&lt;/li&gt;
  &lt;li&gt;el editor de texto que uses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Para este post se usa el siguiente entorno:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;editor de texto&lt;/strong&gt;: VSCode&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;sistema operativo&lt;/strong&gt;: Linux&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;proyecto&lt;/strong&gt;: &lt;a href=&quot;https://github.com/LuisReinoso/inventario-app&quot;&gt;inventario-app&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;estructura-del-proyecto&quot;&gt;Estructura del proyecto&lt;/h2&gt;

&lt;p&gt;Partiendo de esta estructura&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-code&quot;&gt;e2e/                         
src/                         
|- app/                      
|  |- core/                  
|  |- shared/                
|  |- app.component.*        
|  |- app.module.ts          
|  |- app-routing.module.ts  
|  +- ...                    
|- assets/                   
|- environments/             
|- theme/                    
|- translations/             
|- index.html                
|- main.scss                 
|- main.ts                   
|- polyfills.ts              
+- test.ts                   
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;estructura-de-carpeta-src&quot;&gt;Estructura de carpeta &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/src&lt;/code&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-code&quot;&gt;src/                         
|- app/                      
|  |- bodega/                 crud bodega
|  |- core/                   funcionalidad principal
|  |- inicio/                 pantalla principal
|  |- login/                  login
|  |- main-nav/               barra de navegación
|  |- producto/               crud producto
|  |- registro/               sign in
|  |- shared/                 funcionalidad compartida
|  |- usuario/                crud usuario
|  |- app.component.*         
|  |- app.module.ts          
|  |- app-routing.module.ts                
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;estructura-módulos&quot;&gt;Estructura módulos&lt;/h3&gt;
&lt;p&gt;Lo ideal es dividir en módulos cada uno de los funcionalidades de tu aplicación
dentro de cada módulo tener:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;components&lt;/li&gt;
  &lt;li&gt;servicios locales&lt;/li&gt;
  &lt;li&gt;module file&lt;/li&gt;
  &lt;li&gt;routing module file&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;&lt;code class=&quot;language-code&quot;&gt;src/                         
|- app/                      
|  |- bodega/                          crud bodega
|  |  |- components/                   componentes de bodega
|  |  |  |- bodega-dialog              componente dialogo
|  |  |- bodega.component.ts               componente principal de bodega
|  |  |- bodega.module.ts                 módulo bodega
|  |  |- bodega-routing.module.ts         módulo routing bodega       
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;nombre-de-los-archivoscarpetas&quot;&gt;Nombre de los archivos/carpetas&lt;/h3&gt;
&lt;p&gt;Realmente el nombre de los archivos recomiendo sea según la funcionalidad que este realice.&lt;/p&gt;

&lt;h3 id=&quot;editor-de-texto&quot;&gt;Editor de texto&lt;/h3&gt;
&lt;p&gt;El editor de texto te puede ayudar principalmente con sus atajos de teclado y los extensiones disponibles en el.&lt;/p&gt;

&lt;h2 id=&quot;atajos-de-teclado&quot;&gt;Atajos de teclado&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Nota&lt;/strong&gt; Los atajos aquí presentados pueden variar de sistema operativo y en posteriores versiones de VSCode&lt;/p&gt;

&lt;p&gt;Para ver los &lt;a href=&quot;https://code.visualstudio.com/docs/getstarted/keybindings&quot;&gt;atajos del teclado de VSCode&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Buscar archivo: Simplemente pones en nombre del feature que buscas.
&lt;kbd&gt;Ctrl&lt;/kbd&gt; + &lt;kbd&gt;p&lt;/kbd&gt;&lt;/p&gt;

    &lt;p&gt;&lt;img src=&quot;/static/img/posts/navegacion_rapida_vscode.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Abrir o cerrar panel lateral: Permite más espacio para ver el archivo
&lt;kbd&gt;Ctrl&lt;/kbd&gt; + &lt;kbd&gt;b&lt;/kbd&gt;&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;Abierto&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;&lt;img src=&quot;/static/img/posts/barra_lateral_abierto_vscode.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;Cerrado&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;&lt;img src=&quot;/static/img/posts/barra_lateral_cerrado_vscode.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;extensiones&quot;&gt;Extensiones&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/ivalexa/vscode-angular2-files&quot;&gt;vscode-angular2-files&lt;/a&gt;
Desde la interfaz te permite crear modulos, componentes, entre otros.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/angular/vscode-ng-language-service&quot;&gt;vscode-ng-language-service&lt;/a&gt;
Plugin que permite utilizar autocompletado y checkeo de errores en el template.
&lt;strong&gt;Nota&lt;/strong&gt;: Ten encuenta que debes tener en tu proyecto &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;@angular/language-service &amp;gt;=v9.0.0&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://github.com/infinity1207/angular2-switcher&quot;&gt;angular2-switcher&lt;/a&gt;
Cambia entre archivos .ts .scss/.css .spec&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;lectura-recomendada&quot;&gt;Lectura recomendada&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://angular.io/guide/styleguide&quot;&gt;Guía estilo Angular&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Mon, 06 Jan 2020 19:00:00 -0500</pubDate>
        <link>https://luisreinoso.dev/angular/2020/01/06/navegacion-rapida-entre-archivos-angular.html</link>
        <guid isPermaLink="true">https://luisreinoso.dev/angular/2020/01/06/navegacion-rapida-entre-archivos-angular.html</guid>
        
        <category>angular</category>
        
        
        <category>angular</category>
        
      </item>
    
      <item>
        <title>Roles en Angular</title>
        <description>&lt;p&gt;Usar ngx-permissions para validar roles usuarios
https://github.com/AlexKhymenko/ngx-permissions&lt;/p&gt;

&lt;p&gt;Instalar&lt;/p&gt;
&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;npm install ngx-permissions  --save
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Agregar al app.module&lt;/p&gt;

&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;NgxPermissionsModule&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;ngx-permissions&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;...&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;NgModule&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;imports&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;NgxPermissionsModule&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;forRoot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;..&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;En método login&lt;/p&gt;
&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;NgxRolesService&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;ngx-permissions&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rolesService&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;NgxRolesService&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){}&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;login&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;servicioAuthenticar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;subscribe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;credencialesDelUsuario&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rolesService&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addRole&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;credencialesDelUsuario&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rol&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;para validar rutas para que accedan según usuario &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NgxPermissionsGuard&lt;/code&gt;
&lt;strong&gt;fuente&lt;/strong&gt;: &lt;a href=&quot;https://github.com/AlexKhymenko/ngx-permissions#usage-with-routes&quot;&gt;rutas&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// permite a differente de tipo rol Externo&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nl&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;ciudad&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;CiudadComponent&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;canLoad&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NgxPermissionsGuard&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nl&quot;&gt;permissions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;except&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Externo&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Externo es el rol que viene de la base de datos&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;para validar en la vista &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*ngxPermissionsOnly&lt;/code&gt;
&lt;strong&gt;fuente&lt;/strong&gt;: &lt;a href=&quot;https://github.com/AlexKhymenko/ngx-permissions#controlling-access-in-views&quot;&gt;controlling-access-in-views&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;ng-container&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;*ngxPermissionsOnly=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;[&apos;Administrador&apos;]&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;button&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;button&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;(click)=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;obtenerNombre()&quot;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    Obtener nombre
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ng-container&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Sat, 04 Jan 2020 19:00:00 -0500</pubDate>
        <link>https://luisreinoso.dev/angular/2020/01/04/roles-en-angular.html</link>
        <guid isPermaLink="true">https://luisreinoso.dev/angular/2020/01/04/roles-en-angular.html</guid>
        
        <category>angular</category>
        
        
        <category>angular</category>
        
      </item>
    
      <item>
        <title>How to mock ActivatedRoute in Angular</title>
        <description>&lt;p&gt;Example applied to &lt;strong&gt;queryParams&lt;/strong&gt; and &lt;strong&gt;params&lt;/strong&gt; of ActivatedRoute&lt;/p&gt;

&lt;p&gt;In this example we have a common use of ActivatedRoute. &lt;strong&gt;Read params from url&lt;/strong&gt;
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;example.component.ts&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ActivatedRoute&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;@angular/router&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ExampleComponent&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;implements&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;OnInit&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

  &lt;span class=&quot;kd&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;activateRoute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ActivatedRoute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;activatedRoute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;subscribe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;params&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;id_params&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;activatedRoute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;queryParams&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;subscribe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;params&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;id_query_params&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Mock is on useValue&lt;/strong&gt;. Set same params of activatedRoute.params or activatedRoute.queryParams inside convertToParamMap&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;example.component.spec.ts&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ExampleComponent&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;./example.component&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ActivatedRoute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;convertToParamMap&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;@angular/router&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;of&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;rxjs&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;ExampleComponent&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ExampleComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;beforeEach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;async&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;TestBed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;configureTestingModule&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;imports&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[...],&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;providers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;provide&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ActivatedRoute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;useValue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Mock&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;queryParams&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
              &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;na&quot;&gt;id_params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;id_params_test&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;
              &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
              &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;na&quot;&gt;id_query_params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;id_query_params_test&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;
              &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
          &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;declarations&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ExampleComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;compileComponents&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}));&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Common error related that this post solve:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;No provider for ActivatedRoute&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Thu, 07 Mar 2019 19:00:00 -0500</pubDate>
        <link>https://luisreinoso.dev/angular/2019/03/07/how-to-mock-activated-route-in-angular.html</link>
        <guid isPermaLink="true">https://luisreinoso.dev/angular/2019/03/07/how-to-mock-activated-route-in-angular.html</guid>
        
        <category>angular</category>
        
        <category>activatedroute</category>
        
        <category>activatedroute data</category>
        
        <category>activated route</category>
        
        <category>activatedroute example</category>
        
        <category>activatedroute get params</category>
        
        <category>activatedroute mock</category>
        
        <category>activatedroute params empty</category>
        
        <category>activatedroute unit test</category>
        
        <category>activatedroute url</category>
        
        <category>queryParams</category>
        
        <category>params</category>
        
        <category>read params from url</category>
        
        <category>mock use value</category>
        
        <category>No provider for ActivatedRoute</category>
        
        
        <category>angular</category>
        
      </item>
    
  </channel>
</rss>
