Skip to content

Property 'controls' does not exist on type 'AbstractControl'. #6099

@shammelburg

Description

@shammelburg

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@Angular/cli: 1.0.1
node: 7.5.0
os: win32 x64
Windows (10)

Repro steps.

Running the application using ng serve works fine.

using ng build works fine.

when using ng build --prod --aot or ng build --prod I get the error.

It points back to this html file and the controls property??

<div formArrayName="Data">
    <div class="form-group" *ngFor="let field of form.get('Data').**controls**; let i = index">
        <div [formGroupName]="i">
            <div class="col-sm-2">
                <input type="text" class="form-control input-sm text-right" placeholder="Key" formControlName="Name" />
            </div>
            <div class="col-sm-6">
                <input type="text" class="form-control input-sm" placeholder="Value" formControlName="Data" autocomplete="off" />
            </div>
            <div class="col-sm-1">
                <i class="fa fa-trash-o cursor remove-field" title="Remove field" (click)="removeField(i)"></i>
            </div>
        </div>
    </div>
</div>

The log given by the failure.

ERROR in ng:///C:/Angular/lanes4/src/app/containers/edit-user.component.html (34,13): Property 'controls' does exist on type 'AbstractControl'.

Desired functionality.

I would like to build it using --prod and --aot

Mention any other details that might be useful.

Happened since updating to version 4.0.0, i've just been using ng build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions