{"id":23138226,"url":"https://github.com/softlayer/sl-ember-modelize","last_synced_at":"2025-08-17T11:32:50.847Z","repository":{"id":23503730,"uuid":"26869423","full_name":"softlayer/sl-ember-modelize","owner":"softlayer","description":"An Ember CLI Addon that takes a nested Plain Old Javascript Object (POJO) and returns an Ember Object, resolving any keys to \"models\" by using the Ember resolver and creating new objects of that model type.","archived":false,"fork":false,"pushed_at":"2016-03-01T16:18:29.000Z","size":1690,"stargazers_count":9,"open_issues_count":8,"forks_count":6,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-11-17T11:20:16.442Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://softlayer.github.io/sl-ember-modelize","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softlayer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-19T16:07:30.000Z","updated_at":"2016-06-14T19:35:53.000Z","dependencies_parsed_at":"2022-08-22T01:30:47.711Z","dependency_job_id":null,"html_url":"https://github.com/softlayer/sl-ember-modelize","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softlayer%2Fsl-ember-modelize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softlayer%2Fsl-ember-modelize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softlayer%2Fsl-ember-modelize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softlayer%2Fsl-ember-modelize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softlayer","download_url":"https://codeload.github.com/softlayer/sl-ember-modelize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230121666,"owners_count":18176477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-17T13:10:11.625Z","updated_at":"2024-12-17T13:10:12.265Z","avatar_url":"https://github.com/softlayer.png","language":"JavaScript","readme":"\n[![Latest Release](https://img.shields.io/github/release/softlayer/sl-ember-modelize.svg)](https://github.com/softlayer/sl-ember-modelize/releases) ![Ember CLI version](https://img.shields.io/badge/ember%20cli-0.1.15-orange.svg) [![License](https://img.shields.io/npm/l/sl-ember-modelize.svg)](LICENSE.md) [![Downloads](https://img.shields.io/npm/dm/sl-ember-modelize.svg)](https://www.npmjs.com/package/sl-ember-modelize)\n\n[![Dependencies](https://img.shields.io/david/softlayer/sl-ember-modelize.svg)](https://david-dm.org/softlayer/sl-ember-modelize) [![Dev Dependencies](https://img.shields.io/david/dev/softlayer/sl-ember-modelize.svg)](https://david-dm.org/softlayer/sl-ember-modelize#info=devDependencies)\n\n[![Build Status](https://img.shields.io/travis/softlayer/sl-ember-modelize/master.svg)](https://travis-ci.org/softlayer/sl-ember-modelize) [![Code Climate](https://img.shields.io/codeclimate/github/softlayer/sl-ember-modelize.svg)](https://codeclimate.com/github/softlayer/sl-ember-modelize)\n\nTo see which issues are currently being worked on or are scheduled to be worked on next, visit [https://huboard.com/softlayer/sl-ember-modelize/#/](https://huboard.com/softlayer/sl-ember-modelize/#/)\n\n---\n\n# What sl-ember-modelize is\n\nA mixin that will take a Plain Old Javascript Object (POJO) and turn it into a series of nested model objects, based on the models registered in your application's container.  This works for objects stored on keys and on arrays of objects stored on keys too.  This mixin will:\n\n* Recursively resolve keys (via the container) on an object and check to see if a model exists that matches that key\n* Create models for keys and store the key's contents in those models\n\n---\n\n# Demo\n\n## Live\n\n[http://softlayer.github.io/sl-ember-modelize/#/demo](http://softlayer.github.io/sl-ember-modelize/#/demo)\n\n## Development Environment\n\n### Installation\n\n* `git clone` this repository\n* `npm install`\n* `bower install`\n\n### Running\n\n* `ember server`\n* View the demo at http://localhost:4200\n\nFor more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/).\n\n---\n\n# How to use this addon in your application\n\n## Install this addon as a Node module\n\n```\nember install:addon sl-ember-modelize\n```\n\n## Use the mixin\n\nInclude it in your objects like so:\n\n```javascript\nimport ModelizeMixin from 'sl-ember-modelize/mixins/modelize';\n\nEmber.Object.extend( ModelizeMixin, {} );\n```\n\nYou can now call `modelize` from within that object like so:\n\n```javascript\nmodelizedObj = this.modelize( POJO );\n```\n\n---\n\n# How it works\n\nConsider this fixture:\n\n```\nfixture: {\n    foo: {\n        bar: {\n            car: [\n                {\n                    name: 'car1',\n                    color: 'blue'\n                },\n                {\n                    name: 'car2',\n                    color: 'red'\n                },\n                {\n                    name: 'car3',\n                    color: 'black'\n                }\n            ],\n            test: 'this is a bar model'\n        },\n        text: 'this is a foo model'\n    }\n}\n```\n\nPassing this POJO through the *modelize* function will cause the object stored in the values for *foo*, *bar*, and\nthe array stored on *car* to be replaced with the models defined for those key names in the app.  *Modelize* looks up\nmodels via Ember's container and if a model is found then it is instantiated with the values from the fixture.\n\n---\n\n# Versioning\nEmploys [Semantic Versioning 2.0.0](http://semver.org/)\n\n---\n\n# Contribution\n[See CONTRIBUTING.md](CONTRIBUTING.md)\n\n---\n\n# Copyright and License\nsl-ember-modelize and its source files are Copyright © 2014 [SoftLayer Technologies, Inc.](http://www.softlayer.com/) The\nsoftware is [MIT Licensed](LICENSE.md)\n\n---\n\n# Warranty\nThis software is provided “as is” and without any express or implied warranties, including, without limitation, the\nimplied warranties of merchantability and fitness for a particular purpose.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftlayer%2Fsl-ember-modelize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftlayer%2Fsl-ember-modelize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftlayer%2Fsl-ember-modelize/lists"}