We have a form component: <label> <h3>Type</h3> <workout-type formControlName="type" ></workout-type> </label> form = this.fb.group({ name: ['', Validators.required], type: 'strength' }); constructor( private…
//switch-control component import { Component } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators} from '@angular/forms'; @Component({ selector: 'switch-control', templateUrl: './switch-control.componen…
One of the most important thing when building custom form component is adding accessbility support. The component should be focusable. we can achieve this by adding 'tabindex="0"': <div tabindex="0" > Add some css class for foucs…
In this tutorial we are going to learn how we can also implement custom form field validation in Angular 2 template driven forms, by creating our own custom validation directive. We are going to see how to write such directive and how its a best prac…
custom form control 之前就写过了,这里简单写一下. 创建一个组件实现 ControlValueAccessor 接口 @Component({ providers: [ { provide: NG_VALUE_ACCESSOR, multi: true, useExisting: MyInputComponent }, ], }) export class MyInputComponent implements ControlValueAccessor {} 实现 write…
XAF ships with the Business Class Library that contains a number of persistent classes ready for use in your applications. All these classes derive from the BaseObject base persistent class declared in the same library. This is a recommended-to-use f…
UE4 中用于绘制自定义网格的插件CustomMeshComponent. 转载: UE4 Tutorial - Custom Mesh Component   Over the last few weeks I've been working on an old idea that I had and ended up starting from scratch. In my research I ended up finding the "Custom Mesh" componen…
MDX Deck is a great library for building slides using Markdown and JSX. Creating a custom Providercomponent allows you to change the markup of the entire deck. This lets you put things like logos and social media handles in each slide easily. In this…
In this lesson we'll learn about how you can use the prop-types module to validate a custom React component's props. You can write you own PropTypes vlidators like such: const PropTypes = { string(props, propName, componentName) { if(typeof props[pro…
Vue Login Form Component Account Login <template> <div> <slot></slot> <el-form class="account-form-container" status-icon :ref="loginFormRef" :model="loginForm" :rules="loginRules"> <…