'use strict'
angular.module 'r2rDesignerApp'
.controller 'RdbReviseCtrl', ($scope, _, Rdb, Rdf) ->
$scope.rdb = Rdb
$scope.rdf = Rdf
$scope.table = ''
$scope.columns = []
$scope.$watch 'rdb.selectedTables()', (val) ->
if val?
$scope.table = _.first $scope.rdb.selectedTables()
$scope.$watch 'table', (val) ->
if val?
$scope.columns = $scope.rdb.selectedColumns()[val]