mirror of https://github.com/nextcloud/contacts
immediately detect changes to gid in route
This commit is contained in:
parent
d721c6f842
commit
8896d3b8e4
|
@ -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() {
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue