If you want to add each item in options
to opt
, then:
let opt = [];
let options = [
{ name: "option1", value: 1 },
{ name: "option2", value: 2 }
]
options.forEach(x => opt.push(x));
More Related Contents:
- Angular File Upload
- Angular 2 / 4 / 5 not working in IE11
- How to reload the current route with the angular 2 router
- The Angular Compiler requires TypeScript >=3.4.0 and
- Should I write methods as arrow functions in Angular’s class
- Dynamically load external javascript file from Angular component
- How to manage Angular2 “expression has changed after it was checked” exception when a component property depends on current datetime
- caching results with angular2 http service [duplicate]
- Property ‘files’ does not exist on type ‘EventTarget’ error in typescript
- Angular Material: mat-select not selecting default
- How to access a constant in an Angular 2 component and service?
- Is there a type for “Class” in Typescript? And does “any” include it?
- angular 2 – adding 3rd party libs
- Ionic – Horizontal scroll tab for Categories [duplicate]
- How to extend / inherit components?
- Difference between interfaces and classes in Typescript
- Generic email validator
- Detect changes in objects inside array in Angular2
- Lazy Loading BrowserModule has already been loaded
- Angular 2 input parameters on root directive [duplicate]
- Angular 2: How to use JavaScript Date Object with NgModel two way binding
- Unit testing click event in Angular
- want to show more data in another component when view in detail button is clicked (angular 6)
- Tracking scroll position and notifying other components about it
- Avoiding relative paths in Angular CLI
- ERROR in TypeError: Cannot read property ‘flags’ of undefined
- Angular 4: How to read data from Excel?
- Sanitize input in Angular2 [duplicate]
- @Input() value is always undefined
- How to pass results between chained observables