sproutcore/sproutcore20 — Issue #217: SC.Binding.from only takes a path as parameter, ignoring root/propertyPath.
Author: juan77
Created: 2011-11-23 12:58:53+00:00
State: open

In SC 1.x we can bind by passing an object and a path to bind, for example:

```javascript
SC.Binding.from(App.myController, ‘myProperty’),
```

And also in an object’s bind we can also pass root/propertyPath as second parameters (the from’s parameter exaclty) like for example:

```javascript
MyController.bind(‘myProperty’, [myOtherController, ‘fromProperty’]);
```

These big ideas wasn’t found or implemented in SC 2.x, and I think that are a bug or critical, because these ideas make the magic shines.

Right now on SC2.0 we only can do using a full path like:

```javascript
SC.Binding.from(‘App.myController.myProperty’),
```
also in object’s bind:

```javascript
MyController.bind(‘myProperty’, 'App.myOtherController.fromProperty’);
```
And looking inside SC.Binding, we see that in the case of from method, is there a this._object attribute that is never used. check it:

https://github.com/sproutcore/sproutcore20/blob/master/packages/sproutcore-metal/lib/binding.js#L366

And looking more deeply is seems that SC.addObserver’s second parameters (that is used in connect method of SC.Binding), only takes a path, and not a tuple of root/propertyPath.

https://github.com/sproutcore/sproutcore20/blob/master/packages/sproutcore-metal/lib/observer.js#L139

For me, this is a stop-breaking in my migration from SC1.x to SC2.x because is a low level implementation and is there no other way to do it. Hope I missing something new or will be in future release, I will be the first to test it.

Thanks,
juan.-