JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="myApp">
<div ng-controller="MyController as ctrl">
<section>
<label for="mytest"
class="input-field-label"></label>
<select id="mytest"
ng-model="ctrl.myObject.myValue"
ng-options="item for item in ctrl.foo()">
</select>
</section>
</div>
</div>
TypeScript
module myApp {
export interface MyObject {
myValue: MyEnum;
}
export enum MyEnum {
Zero = 0,
One = 1,
}
export class MyController {
public myObject: MyObject;
constructor() {
this.myObject = {
myValue: MyEnum.One,
};
}
public foo(): string[] {
return Object.keys(MyEnum).filter(k => {typeof MyEnum[k] === "number"}) as string[];
}
}
angular.module('myApp', [])
.controller('MyController', MyController);
}