immediately detect changes to gid in route

This commit is contained in:
Hendrik Leppelsack 2016-02-18 15:19:57 +01:00 committed by Thomas Müller
parent d721c6f842
commit 8896d3b8e4
4 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
app.controller('contactlistCtrl', ['$scope', 'ContactService', '$routeParams', function($scope, ContactService, $routeParams) {
var ctrl = this;
$scope.gid = $routeParams.gid;
ctrl.routeParams = $routeParams;
ContactService.registerObserverCallback(function(contacts) {
$scope.$apply(function() {

View File

@ -5,7 +5,7 @@ app.filter('contactGroupFilter', [
if (typeof contacts === "undefined") {
return contacts;
}
if (typeof group === "undefined" || group === 'all') {
if (typeof group === "undefined" || group.toLowerCase() === 'all') {
return contacts;
}
var filter = [];

View File

@ -126,7 +126,7 @@ app.directive('contactdetails', function() {
app.controller('contactlistCtrl', ['$scope', 'ContactService', '$routeParams', function($scope, ContactService, $routeParams) {
var ctrl = this;
$scope.gid = $routeParams.gid;
ctrl.routeParams = $routeParams;
ContactService.registerObserverCallback(function(contacts) {
$scope.$apply(function() {
@ -611,7 +611,7 @@ app.filter('contactGroupFilter', [
if (typeof contacts === "undefined") {
return contacts;
}
if (typeof group === "undefined" || group === 'all') {
if (typeof group === "undefined" || group.toLowerCase() === 'all') {
return contacts;
}
var filter = [];

View File

@ -1,4 +1,4 @@
<button class="app-content-list-button" type="button" name="button" ng-click="ctrl.createContact()">Add contact</button>
<div class="app-content-list-item" ng-repeat="contact in ctrl.contacts | contactGroupFilter:gid | orderBy:'fullName()' track by contact.uid()" contact data="contact">
<div class="app-content-list-item" ng-repeat="contact in ctrl.contacts | contactGroupFilter:ctrl.routeParams.gid | orderBy:'fullName()' track by contact.uid()" contact data="contact">
</div>