Change the background color of a div in angular
<p>I would like to change the bg colour of div when clicked on that particular div.
The div is placed in a slider panel. For example, if I click Home, the slider gets hidden and the home panel opens up. Again when I open the slider, the bg colour should be retained to say that I am in Home panel. I tried using ng-style and ng-class, but it doesnt work.</p>
<pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;menu-grid-con all-icons&quot;&gt;
  &lt;div class=&quot;row&quot;&gt;
    &lt;div class=&quot;col col-50 text-center&quot; ng-click=&quot;menu.onHomeButtonClick()&quot;&gt;
      &lt;img src=&quot;images/iconHome.png&quot; class=&quot;menu-icons&quot;&gt;
      &lt;br&gt; &lt;!-- TODO: to change --&gt;
      &lt;p translate=&quot;MENU_HOME&quot; class=&quot;menu-icon-text&quot;&gt;&lt;/p&gt;
    &lt;/div&gt;
    &lt;div 
      class=&quot;col col-50 text-center&quot; 
      ng-click=&quot;menu.onFlyerButtonClick()&quot; 
      ng-style={&quot;background-color:blue;} &quot;
    &gt;
      &lt;img src=&quot;images/iconWeeklyFlyer.png&quot; class=&quot;menu-weekly-flyer-icons&quot;&gt;
      &lt;br&gt; &lt;!-- TODO: to change --&gt;
      &lt;p translate=&quot;MENU_WEEKLY&quot; class=&quot;menu-icon-text&quot;&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>