0

I have a nested EmberJS model hierarchy:

{
  name: 'abc',
  type: 123,
  rules: {
           condition1 : 'value1',
           condition2:   'value2'
           subrule: {
                       subcondition1: 'value1',
                       subcondition2: 'value2'
                     }
         }

I am not using Ember DS. The problem is to give the model object arrays to a previewer which consumes JSON and not a typical get/set API of Ember Objects.

4

1 回答 1

0

如果要对对象进行 JSON 编码,可以使用JSON.stringify方法

JSON.stringify(obj)

这是一个工作示例

于 2012-10-29T08:36:29.693 回答