Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Updated to support Angular 2.0.0 final #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, Host } from '@angular/core';
import { NgForm, ControlGroup } from '@angular/common';
import { NgForm, FormGroup } from '@angular/forms';

@Component({
selector: 'ac-form-errors',
Expand All @@ -23,8 +23,8 @@ export class AcFormErrors {
}

get errorMessages(): Array<{type: string, message: string}> {
var form: ControlGroup = this.formDir.form;
var control = form.find(this.controlPath);
var form: FormGroup = this.formDir.form;
var control = form.get(this.controlPath);
var _errors = [];
if (control !== undefined && control !== null && control.touched) {
let errors = Object.keys(this.errorTypes);
Expand Down