【发布时间】:2020-01-12 23:39:45
【问题描述】:
我有以下sn-p
angular.module('workflow-render', ['ng'] ).directive('workflowRender', ['$parse', '$http', '$sce', '$timeout', function ($parse, $http, $sce, $timeout) {
return {
restrict: 'EA',
replace: false,
scope: {
retVal : '='
},
template: '<div data-ng-if="displayError" style="min-height:150px;"><center><span data-i18n-content="{bundle : \'widgets\', key : \'workflow/Error\'}"></span></center></div>',
link: function($scope, elem, attrs) {
$scope.$watch( 'retVal' , function( newVal ) {
if ( newVal ) {
Render($scope.retVal);
}
我想换行
template: '<div data-ng-if="displayError" style="min-height:150px;"><center><span data-i18n-content="{bundle : \'widgets\', key : \'workflow/Error\'}"></span></center></div>
与
template: '<div data-ng-if="displayError" style="min-height:150px;"><center><span style="color:darkolivegreen;font-weight:bold">Sorry, unable to render workflow due to presence of cyclic workflow transition. We will fix this soon.</span></center></div>
我尝试了类似问题的建议,但找不到反引号特殊字符的方法。
请帮助。谢谢
【问题讨论】:
-
如果只有一个“中心”出现,我想您至少可以简化要替换为
center.*的字符串。 -
彼得,你能详细说明一下吗?
-
请展示您的尝试。