DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
    • can-component
    • can-compute
    • can-connect
    • can-define
    • can-define/list/list
    • can-define/map/map
    • can-route
    • can-route-pushstate
    • can-set
      • types
        • Set
        • Compares
        • Prop
      • properties
        • Algebra
        • Translate
        • props
    • can-stache
    • can-stache/helpers/route
    • can-stache-bindings
  • Ecosystem
  • Infrastructure
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Core
  • /
  • can-set
  • /
  • Translate
  • / On this page
    • Translate

      function
      • source

      new set.Translate(clauseType, propertyName)

      Localizes a clause's properties within another nested property.

      var algebra = new set.Algebra(
        new set.Translate("where","$where")
      );
      algebra.has(
        {$where: {complete: true}},
        {id: 5, complete: true}
      ) //-> true
      

      This is useful when filters (which are where clauses) are within a nested object.

      Parameters

      1. clause {String}:

        A clause type. One of 'where', 'order', 'paginate', 'id'.

      2. propertyName {String|Object}:

        The property name which contains the clauses's properties.

      Returns

      {Compares}:

      A set compares object that can do the translation.

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.