Skip to content

Commit

Permalink
fix publicfields filter
Browse files Browse the repository at this point in the history
  • Loading branch information
tardyp committed Oct 30, 2015
1 parent 4f891e3 commit 0c0aed2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions www/base/src/app/common/filters/publicFields.filter.coffee
@@ -1,7 +1,10 @@
class PublicFields extends Filter('common')
constructor: ->
return (object) ->
copy = angular.copy(object)
for k of object
if k.indexOf('_') == 0 then delete copy[k]
return object
if not object?
return object
object._publicfields ?= {}
for k, v of object
if k.indexOf('_') != 0 and object.hasOwnProperty(k)
object._publicfields[k] = v
return object._publicfields

0 comments on commit 0c0aed2

Please sign in to comment.