If you want to create a own custom directive then you have to follow this steps. Here, i have created a directive with name fontcolor.directive.ts . its change the color and underline when some mouse event occurs. First, Generate a directive using Angular CLI using below coomand. ng generate fontcolor then you push below code. You can
Month: June 2018
Set angular 2 dynamic page title
Create a title service class name like title.service.ts and put below code. import { Injectable } from ‘@angular/core’; import ‘rxjs/add/operator/filter’; import ‘rxjs/add/operator/map’; import ‘rxjs/add/operator/mergeMap’; import { Router, NavigationEnd, ActivatedRoute } from ‘@angular/router’; import { Title } from ‘@angular/platform-browser’; const APP_TITLE = ‘My App’; const SEPARATOR = ‘ | ‘; @Injectable() export class TitleService { constructor(
How to create and use of a custom component to angular Js 2 ?
If you want to create a custom component on Angular JS 2 then you have to follow below steps. Using Angular CLI =================== Just type this code on your cmd. ng generate component component_name Or you can do it manually create a component file with extension .component.ts like testcomponent.component.ts. Put below code onto this file
Make secure contact form from Spam Robot
1) One of the most common problems when having any kind of forms on a site is receiving spam. The more popular the site is, the more likely it will become a target for spamming entities and more difficult is to stop form spam. The use of Captcha is an easy and effective way of
Make a Custom Captcha in PHP
If you make a custom captcha using php then you should follow below code. First i have generate random string using below code in captcha.php <?php session_start(); $string = ”; for ($i = 0; $i < 5; $i++) { // this numbers refer to numbers of the ascii table (lower case) $string .= chr(rand(97, 122));