Replace single quote with appropriate entity when generating new attribute

This commit is contained in:
mabashian 2019-02-13 09:32:46 -05:00
parent 06ff26752a
commit ef89195e6c

View File

@ -22,7 +22,7 @@ angular.module('GeneratorHelpers', [systemStatus.name])
.factory('Attr', function () {
return function (obj, key, fld) {
var i, s, result,
value = (typeof obj[key] === "string") ? obj[key].replace(/[\'\"]/g, '"') : obj[key];
value = (typeof obj[key] === "string") ? obj[key].replace(/[\"]/g, '"').replace(/[\']/g, ''') : obj[key];
if (/^ng/.test(key)) {
result = 'ng-' + key.replace(/^ng/, '').toLowerCase() + "=\"" + value + "\" ";