Support for hierarchical and attribute css selectors.

This commit is contained in:
Nedyalko Nikolov
2016-02-12 11:26:50 +02:00
parent c0682fce80
commit 6e4d6ccfbc
6 changed files with 924 additions and 89 deletions

View File

@@ -9,6 +9,7 @@ import viewModule = require("ui/core/view");
import * as applicationModule from "application";
import * as polymerExpressionsModule from "js-libs/polymer-expressions";
import * as specialPropertiesModule from "ui/builder/special-properties";
import * as utils from "utils/utils";
//late import
var application: typeof applicationModule;
@@ -332,8 +333,7 @@ export class Binding {
// text="{{ sourceProperty = $parents['ListView'].test, expression = $parents['ListView'].test + 2}}"
// update expression will be '$newPropertyValue + 2'
// then on expression execution the new value will be taken and target property will be updated with the value of the expression.
var escapeRegex = /[-\/\\^$*+?.()|[\]{}]/g;
var escapedSourceProperty = this.options.sourceProperty.replace(escapeRegex, '\\$&');
var escapedSourceProperty = utils.escapeRegexSymbols(this.options.sourceProperty);
var expRegex = new RegExp(escapedSourceProperty, 'g');
var resultExp = this.options.expression.replace(expRegex, bc.newPropertyValueKey);
return resultExp;