Link to home
Start Free TrialLog in
Avatar of tesmc
tesmcFlag for United States of America

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.

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>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mlanda T
Mlanda T
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tesmc

ASKER

thx