provider.itemFieldValue = function(item, column) {
return provider.nestedItemFieldValue(item, column);
};
- $scope.gridDataProvider = provider;
function addCheckout(co) {
$scope.checkouts.push(co);
- $scope.gridDataProvider.increment();
+ provider.increment();
}
+
+ $scope.gridDataProvider = provider;
// -----------------------------
$scope.selectedNcType = function() {
idField : '@',
// Reference to externally provided egGridDataProvider
+ // BEWARE: the grid removes everything from its scope that
+ // is not needed within the template. "=" sets up a two-way
+ // binding between the grid and the calling scope. After
+ // grid initiation, the itemsProvider attribute within the
+ // shared scope space will be set to undefined.
+ //
+ // In other words:
+ //
+ // template => items-provider="myProvider"
+ //
+ // controller => $scope.myProvider === undefined
+ //
+ // Storing the provider in the local scope just hogs
+ // resources, anyway.
+ //
itemsProvider : '=',
// comma-separated list of supported or disabled grid features