试图做这样的事情:
var data = {some: 'data'}
var subcomponent = $compile('<div component-' + componentName + ' ng-model="'+data+'"></div>')($scope);
$element.find('.container').html( subcomponent[0] );
我得到错误:
Error: [$parse:syntax] Syntax Error: Token 'Object' is unexpected, expecting []] at column 9 of the expression [[object Object]] starting at [Object]]
试图将这些数据放到link
范围内。有没有办法将数据传递给指令范围?