• Placement Papers
  • Question Papers

Padhle

Online Training Institute

September 27, 2018 by Shubhankar Dubey

Custom Validations in Angular Forms

We often are going to want to write our own custom validations. To see how validators are implemented, let’s look at Validators.required from the Angular core source:

1
2
3
4
5
6
 
export class Validators {
static required(c: FormControl): StringMap<string, boolean> {
return isBlank(c.value) || c.value == "" ? {"required": true} : null;
}
 

A validator: – Takes a FormControl as its input and – Returns a StringMap<string, boolean> where the key is “error code” and the value is true if it fails Writing […]

Article by Shubhankar Dubey / Angular Js Tutorials / Custom Validations in Angular Forms

September 27, 2018 by Shubhankar Dubey

Dependency Injection in Angular

As our programs grow in size, parts of the app need to communicate with other modules. When module A requires module B to run, we say that B is a dependency of A. One of the most common ways to get access to dependencies is to simply import a file. For instance, in this hypothetical module we might […]

Article by Shubhankar Dubey / Angular Js Tutorials / Dependency Injection in Angular

September 27, 2018 by Shubhankar Dubey

Dependency Injection Parts in Angular

To register a dependency we have to bind it to something that will identify that dependency. This identification is called the dependency token. For instance, if we want to register the URL of an API, we can use the string API_URL as the token. Similarly, if we’re registering a class, we can use the class itself as its […]

Article by Shubhankar Dubey / Angular Js Tutorials / Dependency Injection Parts in Angular

September 27, 2018 by Shubhankar Dubey

Providing Dependencies with NgModule in Angular

While it’s interesting to see how an injector is created directly, that isn’t the typical way we’d use injections. Instead, what we’d normally do is 1) use NgModule to register what we’ll inject – these are called providers 2) use decorators (generally on a constructor) to specify what we’re injecting By doing these two steps Angular […]

Article by Shubhankar Dubey / Angular Js Tutorials / Providing Dependencies with NgModule in Angular

September 27, 2018 by Shubhankar Dubey

Providers in AngularJS

There are several ways we can configure resolving injected dependencies in Angular. For instance we can: 1) Inject a (singleton) instance of a class (as we’ve seen) 2) Inject a value Using a Class Injecting a singleton instance of a class is probably the most common type of injection. When we put the class itself into the list […]

Article by Shubhankar Dubey / Angular Js Tutorials / Providers in Angular

  • 1
  • 2
  • 3
  • …
  • 1381
  • Next Page »

Offer of the Day

Amazon Deals of the Day Flipkart Deals of the Day

Recent Posts

  • Custom Validations in Angular Forms
  • Dependency Injection in Angular
  • Dependency Injection Parts in Angular
  • Providing Dependencies with NgModule in Angular
  • Providers in AngularJS
  • Contact Us
  • Site Map
  • Disclaimer
  • Terms of Use & Privacy Policy
  • About Us

Copyright © 2019 · Education Pro Theme on Genesis Framework · WordPress · Log in