-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Daniel Fly
committed
Feb 15, 2015
1 parent
cdd4837
commit b88723b
Showing
6 changed files
with
156 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
app.controller('Ctrl6', function($scope) { | ||
$scope.users = [ | ||
{id: 1, name: 'Aaron'}, | ||
{id: 2, name: 'David'}, | ||
{id: 3, name: 'Moses'} | ||
]; | ||
|
||
$scope.selectedUsers = []; | ||
|
||
$scope.compareFn = function(obj1, obj2){ | ||
return obj1.id === obj2.id; | ||
}; | ||
|
||
$scope.checkFirst = function() { | ||
$scope.selectedUsers = $scope.users[0]; | ||
}; | ||
|
||
$scope.checkAll = function() { | ||
$scope.selectedUsers = $scope.users; | ||
}; | ||
|
||
$scope.uncheckAll = function() { | ||
$scope.selectedUsers = []; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
describe('filter', function() { | ||
|
||
beforeEach(function() { | ||
browser().navigateTo(mainUrl); | ||
}); | ||
|
||
var s = '[ng-controller="Ctrl6"] '; | ||
var a = s+' input[type="checkbox"]'; | ||
|
||
//it('should check of roles are changed to new value before checklist-change is fired', function() { | ||
// element(s+'button[ng-click="checkFirst()"]').click(); | ||
// check(a, [1,0,0,0]); | ||
// expect(element(s+'pre').text()).toBe('a'); | ||
//}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<label ng-repeat="(key, user) in users"> | ||
<input type="checkbox" checklist-model="selectedUsers" checklist-value="user" checklist-comparator="compareFn"> {{user.name}} | ||
</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters