angularjs - How to dynamically configure ng-grid -
i have view in angularjs application in want allow user select between various differently configured grids. ideally bind value passed ng-grid directive model variable, illustrated below. however, although example renders markup works when simple string value passed ng-grid (ie. <div class="gridstyle" ng-grid="gridoptions1"></div> , dynamic configuration fails. var app = angular.module('myapp', ['nggrid']); app.controller('myctrl', function($scope) { $scope.option; $scope.mydata = [{name: "moroni", age: 50}, {name: "tiancum", age: 43}, {name: "jacob", age: 27}, {name: "nephi", age: 29}, {name: "enos", age: 34}]; $scope.gridoptions1 = { data: 'mydata', columndefs: [{ field:"name", displayname: "name"}, { field:...