Fix for using css attribute selector alone.

This commit is contained in:
Nedyalko Nikolov
2016-04-07 17:04:23 +03:00
parent 19acc86e26
commit 3eb8514e96
2 changed files with 14 additions and 1 deletions

View File

@ -24,7 +24,7 @@ export class CssSelector {
constructor(expression: string, declarations: cssParser.Declaration[]) {
if (expression) {
let leftSquareBracketIndex = expression.indexOf(LSBRACKET);
if (leftSquareBracketIndex > 0) {
if (leftSquareBracketIndex >= 0) {
// extracts what is inside square brackets ([target = 'test'] will extract "target = 'test'")
let paramsRegex = /\[\s*(.*)\s*\]/;
let attrParams = paramsRegex.exec(expression);