Use ng-show instead of ng-if.
ng-if creates it's own scope so any scope variables you use inside of an ng-if will be related to a different scope. For example...
<div ng-if='selectedColors'>
{{iAmDefinedInAController}}
</div>
The variable 'iAmDefinedInAController' will be empty even if it is defined in the controller because a new scope is created inside the ng-if.
ng-show does not do this, so just use that and you will be good to go.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…