Angular way of binding object array in a Html Select / Combo box. <h1>Object Binding with Select / Combobox</h1>Select value :<select (change)=”handleChange($event.target.selectedIndex)” name=”cmbTipoTexto” class=”form-control form-control-sm col-sm-7″ id=”cmbTipoTexto” > <option *ngFor=”let item of textTypes” [value]=”item.id”> {{ item.displayValue }} </option></select><br /><br /><br /><b>Selected Object:</b><br />{{ selectedObject | json }}
Enums to Object Array enum Colors { White, Black, Red, Blue, Green } ————————————————————————————————- ColorsList: any[]; ngAfterViewInit() { this.enumsToObjectList(); } enumsToObjectList() { let keys = Object.keys(Colors); // extract enum key & values let filteredKeys = keys.filter(k => !isNaN(+k)); // filter only non numeric values // compose or transform object array this.ColorsList = filteredKeys.map((k) => { return { key: k, value: Colors[+k] } }); }
Node.js is a powerful JavaScript runtime that allows you to build server-side applications. Node.js and Express.js are popular tools for building web applications and APIs. In this step-by-step guide, we’ll walk you through the process of setting up a basic Node.js application with the Express.js …
ArchiMate is a popular modeling language specifically designed for enterprise architecture. It provides a comprehensive framework for describing, analyzing, and visualizing different aspects of an organization’s structure, processes, systems, and strategies. The primary goal of ArchiMate is to enable clear communication and understanding of complex …
In this article we will see how to share static assets like css, libraries, etc., to the asp.net web projects. So that we can maintain uniformity or common user experience across applications. I assume, you are already familiar with asp.net core and creating Razor Class …
In this short article, we will have a step by step walkthrough of implementing application logging using the Serilog library for Desktop applications with WPF / WPF Core technologies. About Serilog Serilog provides a simple and easy to use solution for application logging into files …
In this short article, we will have two different approaches to display an image that’s been fetched from an API response. The requirement is to display a default placeholder image, then at runtime based on the availability, we will replace the image that was received …
In this short article, we will look into a simple use case where we use a Global Query Filter feature in Entity Framework. Scenario / Use Case There might be cases, we need to apply default filter criteria, whenever we query a table. For example, …
In this article, we will discuss the repository pattern. Then we will have a walk-through of the step-by-step implementation of a Repository Pattern in a C# project. Data Access Layer It is good we have several ORM mappers like, Dapper, EntityFramework, etc., These libraries are doing …
Configuration and Middleware UsePathBase middleware, to configure a different base path, this approach will not be disabled the default url/path Creating a Custom Middleware class and an extension method to invoke the same. Partial Views Invoke/render a partial view and passing data model Invoke/render a …