app/assets/javascripts/try_api/param.directive.js.coffee in try_api-0.0.10 vs app/assets/javascripts/try_api/param.directive.js.coffee in try_api-0.0.11
- old
+ new
@@ -1,12 +1,17 @@
angular.module 'param', []
angular.module('param').directive 'param', [
- '$filter'
- ($filter) ->
+ '$filter',
+ '$sce'
+ ($filter, $sce) ->
link = (scope, element, attrs, ctrl) ->
scope.unique_id = Math.random()
+
+ scope.getHtml = (html) ->
+ return $sce.trustAsHtml(html)
+
return {
link: link
restrict: 'A'
require: 'ngModel'
scope:
@@ -27,19 +32,19 @@
' <span class="onoffswitch-switch"></span>' +
' </div>' +
' <div ng-switch-when="image" image=true" ng-model="parameter.value"></div>' +
' <input ng-switch-default type="text" class="form-control" ng-model="parameter.value" placeholder=\'{{ parameter.required ? "required" : "optional"}}\'>' +
' </div>' +
- ' <div class="text-muted small">{{ parameter.description }}</div>' +
+ ' <div class="text-muted small" ng-bind-html="getHtml(parameter.description)"></div>' +
'</div>' +
'<div class="col-md-12" ng-if=\'parameter.type == "array"\'>' +
' <div class="row">' +
' <div class="col-md-4 text-right">' +
' <b>{{ parameter.name }}</b>' +
' <span class="text-muted label label-warning">{{ parameter.type }}</span>' +
' </div>' +
' <div class="col-md-8">' +
- ' <div class="text-muted small">{{ parameter.description }}</div>' +
+ ' <div class="text-muted small" ng-bind-html="getHtml(parameter.description)"></div>' +
' </div>' +
' </div>' +
' <div paramsarray ng-model="parameter"></div>' +
'</div>'
}
\ No newline at end of file