Closed kdagithub closed 4 years ago
From the documentation link that you've posted I've noticed the following note:
Note: Special characters need to be escaped as follows:
" "
' '
< <
> >
& &
Try the following
<Label text="{{ message, (message != null && message.length > 0) ? message : 'nope', false }}" class="h2 text-center" textWrap="true"/>
Environment
CLI: 6.2.2
Cross-platform modules: 6.2.3
Android Runtime: 6.2.0
iOS Runtime: 6.2.0
Plugin(s): none
Node.js: 10.13.0
[ ] Please, attach your package.json and webpack.config.js as these configurations are usually critical for investigating issues with webpack
Describe the bug
WARNING in ./main-page.xml Module Warning (from ../node_modules/nativescript-dev-webpack/xml-namespace-loader.js): Invalid character in entity name Line: 41 Column: 52 Char: & @ \b_[\w-]*\.)scss)$ (. sync (?<!\bApp_Resources\b.*)(?<!\.\/\btests\b\/.*?)\.(xml|css|js|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$) ./main-page.xml @ ./app.js
The cause for the warning is the character '&' in the dataBinding logical comparison expression:
(message != null && message.length > 0)
The expression should be valid according to the docs: Supported Expressions
To Reproduce tns run android
Expected behavior The warning was not shown in version 1.2.0 and should be valid.
Sample project actionbartest.zip