We will use 'HostListener' and 'HostBinding' to accomplish the task. The HTML: <label> Credit Card Number <input name="credit-card" type="text" credit-card placeholder="Enter your 16-digit card number"> </label…
In this post, we are going to create our own structure directive *ngFor. What it should looks like in HTML? <div> <ul> <li *myFor="let item of items; let i = index;"> {{ i }} Member: {{ item.name | json }} </li> <templ…
Create a directive to check no special characters allowed: import {Directive, forwardRef} from '@angular/core'; import {AbstractControl, NG_VALIDATORS, Validator} from '@angular/forms'; @Directive({ selector: `[formControl][no-special-chars], [formCo…
Directive ables to change component behaives and lookings. Directive can also export some APIs which enable behaivor changes control by outside directive iteslf. For example, we have an tooltip: It is a directive: import { Input, Directive, ElementRe…
First, What is directive, what is the difference between component and directive. For my understanding, component is something like 'canvas', 'form', 'table'... they have the template and their own functionality. It defines how a html tag should work…
关于angular 自定义directive的小结 首先我们创建一个名为"expander"的自定义directive指令: angular.module("myApp",[]).directive("expander",function(){ return{ //directive的一些属性(键值对形式)如下: /* restrict:'EA', replace:true, transclude:true, scope:{...}, templ…
今日尝试用python建立一个restful服务. 原文地址:http://www.dreamsyssoft.com/python-scripting-tutorial/create-simple-rest-web-service-with-python.php?/archives/6-Create-a-simple-REST-web-service-with-Python.html Create a simple REST web service with Python This is a q…
directive: import { Directive, HostListener, HostBinding, ElementRef } from '@angular/core'; @Directive({ selector: '[credit-card]' }) export class CreditCardDirective { @HostBinding('style.border') border: string; @HostListener('input', ['$event'])…
https://mapr.com/blog/real-time-credit-card-fraud-detection-apache-spark-and-event-streaming/ Editor's Note: Have questions about the topics discussed in this post? Search for answers and post questions in the Converge Community. In this post we are…
http://gumstix.org/create-a-bootable-microsd-card.html Create a Bootable MicroSD Card Beginners Note: The following instructions are intended for experienced Gumstix users. Beginners are recommended to use Linaro or Sakoman's daily GNOME builds. Supp…