我无法访问此组件的构造函数中的属性 val
@NgComponent(
selector: 'dartcomp',
templateUrl: 'dartComp.html',
publishAs: 'ctrl',
map: const
{
'val' : '@val'
}
)
class DartComp
{ String val;
DartComp()
{ print("construktor DartComp $val");
}
}
在 index.html 中使用
<dartcomp id="dc" val="x"></dartcomp>
有没有办法在构造函数中访问 val ?