Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
feature(macTable): Storing parent scope on table object
Browse files Browse the repository at this point in the history
Closes #145
  • Loading branch information
colinkahn authored and adrianlee44 committed Jan 27, 2014
1 parent 3353618 commit 585243e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/directives/table/table_view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ angular.module("Mac").factory "MacTableController", ["Table", (Table) ->
hasReorderableColumns: false

makeTable: (columns) ->
@table = @scope.table = new Table columns
@table = @scope.table = new Table columns
@table.$parent = @scope.$parent
]

angular.module("Mac").directive "macTable", [ "MacTableController", (MacTableController) ->
Expand Down
4 changes: 4 additions & 0 deletions test/unit/table_view.spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ describe "Table View", ->
it "Should set the width automatically", ->
expect(element.find("[mac-cell-template]").first().attr("width")).toBe "50%"

describe "Scope References", ->
it "Stores the parent scope on the table object", ->
expect(element.scope().table.$parent).toBe scope

describe "Section Controllers", ->

beforeEach inject (TableSectionController) ->
Expand Down

0 comments on commit 585243e

Please sign in to comment.