{"action":"created","issue":{"url":"https://api.github.com/repos/marmelab/ng-admin/issues/647","labels_url":"https://api.github.com/repos/marmelab/ng-admin/issues/647/labels{/name}","comments_url":"https://api.github.com/repos/marmelab/ng-admin/issues/647/comments","events_url":"https://api.github.com/repos/marmelab/ng-admin/issues/647/events","html_url":"https://github.com/marmelab/ng-admin/issues/647","id":104370777,"number":647,"title":"Can't show/hide a field with a directive & ng-show","user":{"login":"aouicher","id":763468,"avatar_url":"https://avatars.githubusercontent.com/u/763468?v=3","gravatar_id":"","url":"https://api.github.com/users/aouicher","html_url":"https://github.com/aouicher","followers_url":"https://api.github.com/users/aouicher/followers","following_url":"https://api.github.com/users/aouicher/following{/other_user}","gists_url":"https://api.github.com/users/aouicher/gists{/gist_id}","starred_url":"https://api.github.com/users/aouicher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aouicher/subscriptions","organizations_url":"https://api.github.com/users/aouicher/orgs","repos_url":"https://api.github.com/users/aouicher/repos","events_url":"https://api.github.com/users/aouicher/events{/privacy}","received_events_url":"https://api.github.com/users/aouicher/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-01T22:58:17Z","updated_at":"2015-12-03T16:24:42Z","closed_at":"2015-09-10T08:10:43Z","body":"Do you any idea about my problem. I want display a field with a button (custom template) with a directive.\r\n\r\nMy app\r\n\r\n```\r\nvar app = angular.module('Admin', ['ng-admin']);\r\nvar showCitationField = false;\r\n```\r\n\r\n\r\nMy fields\r\n\r\n```javascript\r\nnga.field('Contenu', 'template')\r\n        .template('<choice-cck></choice-cck>'),\r\nnga.field('citationId', 'reference')\r\n        .attributes({ 'ng-show': \"showCitationField\" })\r\n        .label('Citation')\r\n        .targetEntity(citations)\r\n        .targetField(nga.field('text'))\r\n```\r\n\r\nMy directive\r\n\r\n```javascript\r\napp.directive('choiceCck', [function () {\r\n  return {\r\n    restrict: 'E',\r\n    link: function($scope, element, attributes) {\r\n      $scope.displayFieldCitation = function() {\r\n        showCitationField = !showCitationField;\r\n        console.log(showCitationField);\r\n      }\r\n    },\r\n    template: '<ul class=\"list-inline\">' +\r\n    '<a class=\"btn btn-default btn-sm\" ng-click=\"displayFieldCitation()\"><i class=\"glyphicon glyphicon-text-size\"></i> Citation</a>&nbsp;' +\r\n    '<li class=\"btn btn-default btn-sm\"><i class=\"glyphicon glyphicon-facetime-video\"></i> Video Agnes</li>&nbsp;' +\r\n    '<li class=\"btn btn-default btn-sm\"><i class=\"glyphicon glyphicon-picture\"></i> Cover</li>'\r\n  };\r\n}]);\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/marmelab/ng-admin/issues/comments/161703631","html_url":"https://github.com/marmelab/ng-admin/issues/647#issuecomment-161703631","issue_url":"https://api.github.com/repos/marmelab/ng-admin/issues/647","id":161703631,"user":{"login":"tanogalego","id":8809003,"avatar_url":"https://avatars.githubusercontent.com/u/8809003?v=3","gravatar_id":"","url":"https://api.github.com/users/tanogalego","html_url":"https://github.com/tanogalego","followers_url":"https://api.github.com/users/tanogalego/followers","following_url":"https://api.github.com/users/tanogalego/following{/other_user}","gists_url":"https://api.github.com/users/tanogalego/gists{/gist_id}","starred_url":"https://api.github.com/users/tanogalego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanogalego/subscriptions","organizations_url":"https://api.github.com/users/tanogalego/orgs","repos_url":"https://api.github.com/users/tanogalego/repos","events_url":"https://api.github.com/users/tanogalego/events{/privacy}","received_events_url":"https://api.github.com/users/tanogalego/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T16:24:42Z","updated_at":"2015-12-03T16:24:42Z","body":"Hi @fzaninotto, I'm having a problem with this, on edition, using cssClasses this way only hide the input field, but not the complete row element, so the label is always visible to the user.. Any ideas?"}}