tesmc
asked on
Display drop down in angular
New to angular, I want a drop down list in my view and have it default to whatever was selected for that user.
I have the following code so far but it does not return a drop down of my Colors. Only returns the selected one with is index=1 (Red). I want Red to be selected but drop down to show other options.
I have the following code so far but it does not return a drop down of my Colors. Only returns the selected one with is index=1 (Red). I want Red to be selected but drop down to show other options.
public class Color
{
private string _shadow;
private ColorTypesConst.Color _type = ColorTypesConst.Color.Color;
//[JsonConverter(typeof(StringEnumConverter))]
public ColorTypesConst.Color Type
{
get { return _type; }
set { _type = value; }
}
public string Shadow
{
get { return _shadow ; }
set { _shadow = value; }
}
public string TypeDisplay
{
get { return _type.ToString(); }
}
}
public class ColorTypesConst
{
public enum Color
{
None,
Red,
Green,
Blue,
Yellow
}
}
<div>
<label>Color:</label>
<dl>
<dd>
{{school.Color.TypeDisplay}}
</dd>
</dl>
</div>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER