Ng-table, hide-columns feature, can't hide columns from controller manually
<p>I have set up ng-table with checkbox buttons to hide columns and it works great.
here is an html</p>

<pre><code>// switchers to hide/show columns
&lt;div style="margin-bottom: 20px"&gt;
    &lt;label class="checkbox-inline" ng-repeat="col in demo.cols"&gt;
      &lt;input type="checkbox" ng-model-options="{ getterSetter: true }" ng-model="col.show"/&gt; {{col.title()}}
    &lt;/label&gt;
  &lt;/div&gt;
// ng table self
  &lt;table ng-table="demo.tableParams" class="table table-condensed table-bordered table-striped" ng-table-columns-binding="demo.cols"&gt;
    &lt;tr ng-repeat="row in $data"&gt;
      &lt;td title="'Name'" ng-if="true"&gt;{{row.name}}&lt;/td&gt;
      &lt;td title="'Age'" ng-if="true"&gt;{{row.age}}&lt;/td&gt;
      &lt;td title="'Money'" ng-if="true"&gt;{{row.money}}&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
</code></pre>

<p><em>and here is controller code</em></p>

<pre><code>    // NG-TABLE PARAMS
  self.cols = [
    { field: "name", title: "Name", show: true },
    { field: "age", title: "Age", show: true },
    { field: "money", title: "Money", show: true}
  ];

  var simpleList = [{"id":1,"name":"Nissim","age":41,"money":454},{"id":2,"name":"Mariko","age":10,"money":-100},{"id":3,"name":"Mark","age":39,"money":291},{"id":4,"name":"Allen","age":85,"money":871},{"id":5,"name":"Dustin","age":10,"money":378},{"id":6,"name":"Macon","age":9,"money":128},{"id":7,"name":"Ezra","age":78,"money":11},{"id":8,"name":"Fiona","age":87,"money":285},{"id":9,"name":"Ira","age":7,"money":816},{"id":10,"name":"Barbara","age":46,"money":44},{"id":11,"name":"Lydia","age":56,"money":494},{"id":12,"name":"Carlos","age":80,"money":193}];

  self.tableParams = new NgTableParams({}, {
    filterDelay: 0,
    dataset: simpleList,
    counts: []
  });
</code></pre>

<p><a href="http://i.stack.imgur.com/x8TY7.png" rel="nofollow">Image</a></p>

<p><strong>Problem</strong></p>

<p>I wanted to create my own button to hide necessarry columns at once, instead of clicking to each column. To do that i created a button with function. <em>Here the button code</em></p>

<pre><code>&lt;button  class="btn btn-default btn-sm" ng:click="demo.hideColumns()"&gt;Hide columns&lt;/button&gt;
</code></pre>

<p><em>and here is the function inside controller</em></p>

<pre><code>self.hideColumns = function(){
    self.cols[1].show = false;
    self.cols[2].show = false;
}
</code></pre>

<p>the code above works, the checkboxes change to unchecked, but the table does not hide columns, I guess the problem somehow related to angular's <code>getter/setter</code> features, but I couldn't solve it.</p>

<p>Dear SO community please help me to solve this problem, 
Thank you</p>

<p><strong>Links</strong></p>

<p><a href="http://ng-table.com/#/columns/demo-visibility" rel="nofollow">Codepen page, where I copied the code</a></p>