ember-instance-scope

Contains a mixin that allows definition of instance specific properties within extend (which adds to the prototype by default) through a custom instanceScope property

Useful for properties that wouldnt be passed to the component instances in the template directly but may still need to be instance specific.

This can be done currently by setting these properties up in the init method but this provides a more declarative approach.

export default Ember.Component.extend(instanceScope,{
	title: "Mr", // Added to prototype
	instanceScope: { //Properties in this are made instance specific by the mixin
	  firstName: "Deepan",
	  lastName: "Aiyasamy",
	  testArray: [1,2,3],
	  testObj: {
	  	prop1: "hello",
	  	testObjArray: ["a","b","c"]
	  }
	},
	fullName: function(){
		return this.get("firstName") + " " + this.get("lastName")
	}.property("firstName", "lastName")
});

Quick demo at http://development.instance-scope-demo.divshot.io/

Prerequisites

You will need the following things properly installed on your computer.

Installation

  • git clone <repository-url> this repository
  • change into the new directory
  • npm install
  • bower install

Running / Development

Code Generators

Make use of the many generators for code, try ember help generate for more details

Running Tests

  • ember test
  • ember test --server

Building

  • ember build (development)
  • ember build --environment production (production)

Deploying

Specify what it takes to deploy your app.

Further Reading / Useful Links