Why is ng-repeat not processed

Discussão em 'Angular' iniciado por Mark B, Fevereiro 9, 2025.

  1. Mark B

    Mark B Guest

    I have been following some user guides / introduction videos, and am struggling to merge a couple of very basic concepts. I have trying to populate a SELECT using the ng-options but it seems its entirely ignored, and appears in the final HTML

    I have app.component.html:


    Please pick an option
    <select ng-options="x for x in myData">



    I have app.compontents.ts:


    import { Component, OnInit } from '@angular/core';

    @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrl: './app.component.css'
    })
    export class AppComponent implements OnInit {

    myData = ['Yes', 'No'];

    constructor() {}

    ngOnInit(): void {}
    }


    Its as though ng-options and ng-repeat is not a thing - I can type any old rubbish into them and it just outputs to the HTML

    Continue reading...

Compartilhe esta Página