angularjs custom directive passing string attribute for templateUrl -
i have directive follows , want able pass templateurl in custom directive
<div ng-if="box.key === 'experiences'" experiences-form template-url="'experiences.php'" // template url trying pass item="item" forms="forms" form-name="{{box.key}}{{item._id}}" onsave="updatemultipleuser(box.key, item._id, $data)" cancel="formaction($formname, 'cancel')" > </div>
ddo directive
{ restrict: 'a', replace: true, scope: { onsave: '&', cancel: '&', formname: '@', forms: '=', item: '=' }, controller: controller, templateurl: function (telement, tattrs) { return tattrs.templateurl; // returns 'experiences.php' how rid of single quotes? } };
why putting quotes in templateurl attribute? should work that:
<div ng-if="box.key === 'experiences'" experiences-form template-url="experiences.php" // template url trying pass item="item" forms="forms" form-name="{{box.key}}{{item._id}}" onsave="updatemultipleuser(box.key, item._id, $data)" cancel="formaction($formname, 'cancel')" > </div>
if doesn't work, copy , paste error message or result get?
Comments
Post a Comment