Mark B
Mark B

Reputation: 1

Why is ng-repeat not processed

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

Upvotes: 0

Views: 27

Answers (0)

Related Questions