app.directive('descType', [function () { return { restrict: 'E', transclude: true, replace: true, scope: { title: '@', message: '@', param: '@', selected: '=', description: '=', descrip: '=', type: '=', doSearch: '&', filterBy: '@?' },Please, note the transclude and replace options.
<input type="submit" value="" id="btnChoose" style="width: 100% !important; margin-top: 0;" class="btn_file_select" ng-click="click()" />and this is an example of using this directive in a page:
<data-desc:type title="{{ '@String.Format(Labels.selectX, Labels.layout)'}}" do-search="popup()" value="{{currentItem['t'+n+'LayoutId'] == 0 ? '@String.Format(Labels.selectX, Labels.layout)' : currentItem['t' + n + 'Layout']}}" param="layouts" message="@String.Format(Labels.selectX, Labels.layout)" filter-by="Ticket" selected="currentItem['t'+n+'LayoutId']" descrip-value="descrip" type-value="lTypeId" description="currentItem['t'+n+'Layout']"> </data-desc:type>I would love to improve this directive. Say, add ability to delete chosen layout (because right now once something is selected, there is no way to remove that selected Layout Id). I also would like to add ability to go directly to the selected layout to edit it.