Underscore.JS: Access local variables and function inside each function of UnderscoreJS in Typescript
Muhammad Hassan
by Muhammad Hassan
3y ago
While using AngularJS with Typescript, I witnessed the scenario, where my function is accessing variables and functions defined in controller constructor, to make life easy for some collection manipulation, I used underscoreJS helper functions, _.each _.each(data, function(item : any) { item.name = this.formatName(item); }); Everything was on track, except I was unable to access local ..read more
Visit website
AngularJS: Error – Argument of type ‘RegExp’ is not assignable to parameter of type ‘string’
Muhammad Hassan
by Muhammad Hassan
3y ago
While working on a test project in AngularJS with Typescript, I came across this specific error: Argument of type 'RegExp' is not assignable to parameter of type 'string' Code: let expression = new RegExp(/(test)=\(A:([0-9.]*)\)/g); The problem is that I am duplicating the initialization process of Regex, first, it set up regular expression by standard syntax ..read more
Visit website
AngularJS: Add line-break or HTML Elements in Angular Bootstrap UI Tooltip
Muhammad Hassan
by Muhammad Hassan
3y ago
In order to add line-break in tool-tip content for angular bootstrap tool-tip component, Please try to understand, There are three versions of the tool-tip: uib-tooltip, uib-tooltip-template, and uib-tooltip-html: uib-tooltip – Takes text only and will escape any HTML provided. uib-tooltip-html $ – Takes an expression that evaluates to an HTML string. Note that this HTML ..read more
Visit website
Angular2: Custom toaster / notification service using Angular2 Material Snackbar Component
Muhammad Hassan
by Muhammad Hassan
3y ago
Since toasters/notifications are essential component for any connected web application, we have couple of toasters component available in market for angular2, I am using Angular Material Snackbar component. Usage Since toasters/notifications are used throughout the application, so its better to define as unified service and then consume it throughout application by injecting service in various ..read more
Visit website
Angular2: Using custom loader / spinner as service in Angular 2 application
Muhammad Hassan
by Muhammad Hassan
3y ago
Since loaders/spinners are essential component for any connected web application, we have couple of spinner component available in market for angular2. For spinner’s css, I am using Absolute Center CSS Overlay Spinner By MattIn4D Usage Since spinner is used throughout the application, so its better to define it once in index.html and then try to ..read more
Visit website
Angular2: Resolve TS5023 Build:Unknown compiler option ‘typeRoots’ and ‘types’ error in Visual Studio
Muhammad Hassan
by Muhammad Hassan
3y ago
I installed fresh copy of Visual Studio 2015 update 3 on my secondary machine and try to execute Angular2 project integrated with ASP.NET CORE and came across an issue TS5023 Build:Unknown compiler option 'typeRoots' TS5023 Build:Unknown compiler option 'types' Solution 1: In VS2015 go to: Tools -> Options -> Projects and Solutions -> External Web ..read more
Visit website
ASP.NET CORE: Sending Email with Gmail and Homtail Account using ASP.NET Core services
Muhammad Hassan
by Muhammad Hassan
3y ago
Sending email from any SMTP server from ASP.NET CORE application is pretty easy, but the flow of command is slight different in core environment. Gmail SMTP server address is smtp.gmail.com. It requires implicit SSL or explicit SSL (TLS) connection, and you should use your Gmail email address as the user name for ESMTP authentication. So ..read more
Visit website
Angular2 in ASP.NET MVC Nuget Package
Muhammad Hassan
by Muhammad Hassan
3y ago
To install Angular2 Template for MVC & WebAPI, run the following command in the Package Manager Console Install-Package Angular2-Template-for-MVC-and-WebAPI This Nuget Package will help you to integrate Angular2 JS framework into ASP.NET MVC or WebAPI applications Package includes ASP.NET MVC compatible tsconfig.json, typings.json, systemjs.config.js, package.json files. Package also includes client side JS libraries reference and ..read more
Visit website
Angular2: Creating custom sort filter pipe for datetime column ngFor directive
Muhammad Hassan
by Muhammad Hassan
3y ago
As you are aware of the fact that, Filters in Angular 1.x have been replaced with pipes in Angular2, most of the time we have datetime value in our array of objects(in easy terms dataset), so in order to display our data on front-end in the form of ASC/DESC datetime column, I have implemented a ..read more
Visit website
Angular2: Creating custom search filter pipe for ngFor directive
Muhammad Hassan
by Muhammad Hassan
3y ago
As you are aware of the fact that, Filters in Angular 1.x have been replaced with pipes in Angular2, unfortunately, search filter for ng-repeat has been dropped in Angular2. So in order to select a subset of items from an array and returns it as a new array for the *ngFor directive, we have to ..read more
Visit website

Follow Muhammad Hassan on FeedSpot

Continue with Google
Continue with Apple
OR