how to write angularjs directive to dynamically allocate scope bindings

is there a way to specify the scope bindings of a particular element through a directive?

eg:

<div g:bind="{width: '=', height: '@'}" width="myWidth" height={{myHeight}}></div>

I don't think so. I believe that when you define the object hash (i.e., the stuff inside scope: { ... }), you must use strings as the keys -- you can't "look them up" elsewhere.

scope: { stringKey1: ..., stringKey2: ... }

AFAIK, only the compile() and link() functions get an Attributes object. You would need that object to do what you want, but you don't have it when the "directive definition object" is being parsed.