0
현재 AngularJS 응용 프로그램을 작성 중이며 $ scope 아래에 값을 일반 값 대신 HTML 태그 값으로 추가하거나 작성하려고합니다.scope.value를 HTML로 추가하는 방법은 무엇입니까?
HTML :
<div gridster="gridsterOptions">
<ul>
<li gridster-item="widget" ng-repeat="widget in dashboard.widgets" class="main-dashboard-container">
<div class="box" ng-controller="CustomWidgetCtrl">
<div class="box-header main-dashboard-header">
<h4>{{ widget.name }}</h4>
<div class="box-header-btns pull-right">
<a title="settings" ng-click="openSettings(widget)"><i class="glyphicon glyphicon-cog"></i></a>
<a title="Remove widget" ng-click="remove(widget)"><i class="glyphicon glyphicon-trash"></i></a>
</div>
</div>
<div class="box-content main-dashboard-content">{{ widget.content }}</div>
</div>
</li>
</ul>
</div>
AngularJS와 코드 : 당신이 AngularJS와 코드에서 볼 수 있듯이
$scope.dashboards = {
'1': {
id: '1',
name: 'Home',
widgets: [{
col: 0,
row: 0,
sizeY: 1,
sizeX: 1,
name: "URL Filter",
content:'<div class="table-responsive " ng-controller="URLFilterCategoriesController as viewAll"><table class="table table-hover"><thead><tr><td>Categories</td><td>Hits</td></tr></thead><tbody><tr ng-repeat="urlfil in viewAll.urlfiltercat"><td>{{urlfil.category}}</td><td>{{urlfil.hit}}</td></tr></tbody></table></div>'
}, {
col: 2,
row: 1,
sizeY: 1,
sizeX: 1,
name: "Widget 2"
}]
},
, 내가 추가 한 HTML 코드의 시리즈와 나는 그것을 추가 할 싶다고/내 HTML 코드 안에 HTML로 추가되었습니다. 감사!