/**
* System configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
(function (global) {
function mapIndex() {
return {
'app': 'app',
'@angular': 'npm:@angular',
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) {
var packages = {
app: {
main: './main.js',
defaultExtension: 'js'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'address', | |
template: ` | |
<fieldset ngModelGroup="address"> | |
<div> | |
<label>Zip:</label> | |
<input type="text" name="zip" ngModel> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const formDirectiveProvider: any = { | |
provide: ControlContainer, | |
useExisting: forwardRef(() => NgForm) | |
}; | |
... | |
@Directive({ | |
selector: 'form:not([ngNoForm]):not([formGroup]),ngForm,[ngForm]', |
OlderNewer