Skip to content Skip to sidebar Skip to footer

Pass Bindings To Templateurl In Angular's Component

My component object looks like this: var options = { bindings: { title: '<', rows: '<' }, controller: registers, templateUrl: function ($eleme

Solution 1:

It isn't related to templateUrl function, no extra actions should be performed there.

If no controllerAs option is specified, controller identifier defaults to $ctrl, not vm. Scope properties should be available in template as

<p>Title: {{$ctrl.title}}</p>
<p>Rows: {{$ctrl.rows}}</p>

Here is a demo that shows this (thanks to @AWolf).

Post a Comment for "Pass Bindings To Templateurl In Angular's Component"