Skip to content

Instantly share code, notes, and snippets.

View alexzuza's full-sized avatar
🎯
Focusing

Alexey Zuev alexzuza

🎯
Focusing
View GitHub Profile
@alexzuza
alexzuza / 0_reuse_code.js
Last active September 22, 2015 10:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/**
 * System configuration for Angular 2 samples
 * Adjust as necessary for your application needs.
 */
(function (global) {
  function mapIndex() {
    return {
      'app': 'app',
      '@angular': 'npm:@angular',
/**
 * System configuration for Angular 2 samples
 * Adjust as necessary for your application needs.
 */
(function (global) {
  var packages = {
    app: {
      main: './main.js',
      defaultExtension: 'js'
@alexzuza
alexzuza / karma.conf.js
Last active September 15, 2019 11:58
angular cli karma config
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
<form #myForm="ngForm">
<div>
<label>Firstname:</label>
<input type="text" name="firstName" ngModel>
</div>
<div>
<label>Lastname:</label>
<input type="text" name="lastName" ngModel>
</div>
</form>
<form #myForm="ngForm">
<div>
<label>Firstname:</label>
<input type="text" name="firstName" ngModel>
</div>
<div>
<label>Lastname:</label>
<input type="text" name="lastName" ngModel>
</div>
<fieldset ngModelGroup="address">
import { Component } from '@angular/core';
@Component({
selector: 'address',
template: `
<fieldset ngModelGroup="address">
<div>
<label>Zip:</label>
<input type="text" name="zip" ngModel>
<form #myForm="ngForm">
<div>
<label>Firstname:</label>
<input type="text" name="firstName" ngModel>
</div>
<div>
<label>Lastname:</label>
<input type="text" name="lastName" ngModel>
</div>
<address></address>
@Directive({selector: '[ngModelGroup]', providers: [modelGroupProvider], exportAs: 'ngModelGroup'})
export class NgModelGroup extends AbstractFormGroupDirective implements OnInit, OnDestroy {
@Input('ngModelGroup') name: string;
constructor(
@Host() @SkipSelf() parent: ControlContainer,
@Optional() @Self() @Inject(NG_VALIDATORS) validators: any[],
@Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: any[]) {
super();
this._parent = parent;
export const formDirectiveProvider: any = {
provide: ControlContainer,
useExisting: forwardRef(() => NgForm)
};
...
@Directive({
selector: 'form:not([ngNoForm]):not([formGroup]),ngForm,[ngForm]',