The picture you want to achieve is as follows:
Now I have implemented the basic shape and function, but when I click on an icon and change the icon next to "Adapted Devices", this function does not produce the expected results.
Please tell me which part I wrote wrong?
1. Here are the icons that will be replaced by clicking the icons in different drop-down boxes next to "Adapted Devices".
(This is the function I want to achieve.)
<i
ng-class="{' ico-screen-pc':pc,
' ico-screen-projector':projector,
' ico-screen-tv':tv}">
</i>
2. This part is in the drop-down box. You can click on different icons
<ul ng-show="show_apparatus">
<li ng-click="displayModeData.choose_display('pc')">
<i title="PC显示屏" class="ico-screen-pc"></i>
</li>
<li ng-click="displayModeData.choose_display('projector')">
<i title="投影仪" class="ico-screen-projector"></i>
</li>
<li ng-click="displayModeData.choose_display('tv')">
<i title="TV显示屏" class="ico-screen-tv"></i>
</li>
</ul>
3. This part is the function code of js
$scope.pc = true;
$scope.displayModeData = {
pc: true,
choose_display : function( displayMode ){
$scope.pc = ( displayMode === 'pc' );
$scope.projector = ( displayMode === 'projector' );
$scope.tv = ( displayMode === 'tv' );
}
};
Please tell me which part of my writing is wrong?
Come on, change it according to mine: