Ionic 4 Angular NgIf binding - ionic4

sorry for my bad English, I would like to consult how to implement * ngIf in this case:
I have a string variable constructed like this:
varname = 'a = 1 && b = 2 && c = 3 && d = 0';
I want to filter a list with elements that have the 4 properties, a, b, c and d.
My question is how can I replace the condition inside the ngIf since it does NOT accept me * ngIf = "{{varname}}"
Thank you very much for the help you could give me
Ionic:
ionic (Ionic CLI) : 4.11.0 (C:\Users\Estelita\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : #ionic/angular 4.11.5
#angular-devkit/build-angular : 0.801.3
#angular-devkit/schematics : 8.1.3
#angular/cli : 8.1.3
#ionic/angular-toolkit : 2.1.1
Cordova:
cordova (Cordova CLI) : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : android 8.1.0
Cordova Plugins : not available
System:
Android SDK Tools : 26.1.1 (C:\Android)
NodeJS : v12.13.1 (C:\Program Files\nodejs\node.exe)
npm : 6.12.1
OS : Windows 8.1

*ngIf does not need the {{ }} brackets to evaluate component properties.
<ion-item *ngIf="varname">
If varname is not null this sentence will be rendered.
</ion-item>
Hope this helps.

Related

Command PhaseScriptExecution failed with a nonzero exit code. Bugsnag source map upload connection timed out

I am trying to white label this github repo.
https://github.com/RocketChat
Here is the white label guide that the RocketChat has provided.
https://developer.rocket.chat/mobile-app/mobile-app-white-labelling/ios-app-white-labelling
This library is for react native. I am facing this issue when I try to run the project.
The project is failing the build process with this error.
> PhaseScriptExecution Upload\ source\ maps\ to\ Bugsnag
> /Users/macbook/Library/Developer/Xcode/DerivedData/RocketChatRN-adkttzebukwzincfwduuaihsdgwi/Build/Intermediates.noindex/RocketChatRN.build/Debug-iphoneos/RocketChatRN.build/Script-88055964DAAE45B1A4886C27.sh
> (in target 'RocketChatRN' from project 'RocketChatRN')
> cd /Users/macbook/Rocket.Chat.ReactNative-develop/ios
> /bin/sh -c /Users/macbook/Library/Developer/Xcode/DerivedData/RocketChatRN-adkttzebukwzincfwduuaihsdgwi/Build/Intermediates.noindex/RocketChatRN.build/Debug-iphoneos/RocketChatRN.build/Script-88055964DAAE45B1A4886C27.sh
>
> ℹ Preparing upload of React Native source map (dev / ios) › Reading
> source map
> "/var/folders/sz/jj5jd6j54kd505vxsyxvlk1h0000gn/T//bcd7e9d7452d009ff844f5acf22fb2f3-main.jsbundle.map"
> › Reading bundle file
> "/Users/macbook/Library/Developer/Xcode/DerivedData/RocketChatRN-adkttzebukwzincfwduuaihsdgwi/Build/Products/Debug-iphoneos/main.jsbundle"
> ℹ Applying transformations to source map › Ensuring sourcesContent
> field is populated › Stripping project root from sources › Initiating
> upload to "https://upload.bugsnag.com/react-native-source-map"
ERROR The request timed out.
Connection timed out
at ClientRequest.<anonymous> (/Users/macbook/Rocket.Chat.ReactNative-develop/node_modules/#bugsnag/source-maps/dist/Request.js:190:21)
at Object.onceWrapper (node:events:641:28)
at ClientRequest.emit (node:events:527:28)
at TLSSocket.emitRequestTimeout (node:_http_client:771:9)
at Object.onceWrapper (node:events:641:28)
at TLSSocket.emit (node:events:539:35)
at TLSSocket.Socket._onTimeout (node:net:516:8)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
I have tried to remove the source map upload. See Screen Shot 1
It keeps on giving the same error still.
It says bugsnag source map failed to upload and is timing out. I have no prior experience with React Native and I am just trying to white label their code. So any help will be appreciated.
Would you be able to check your package.json file for which version of #bugsnag/source-maps you are using? If you are using anything prior to v2.3.0 of #bugsnag/source-maps you could try updating as it has now increased the default timeout and made some other improvements.
Try this, (M1 Mac only I guess)
Go to the target you want to archive
Build settings ---> Architectures ---> Excluded Architectures
Delete arm64
Also another possible reason could be that Xcode is using an outdated version of Node
By default, Xcode will use the Node binary located at /usr/local/bin/node. Check its version by running:
/usr/local/bin/node -v
node -v
If the first command outputs an older version of Node, simply delete it and replace it with a symlink to the newer one:
rm -rf /usr/local/bin/node
ln -s $(which node) /usr/local/bin/node

I'm getting a weird (ERRCODE 243) error when installing a 3rd party js package using Rush.js by running `rush add --package <package>`

my team is migrating to rush and I had a problem while setting it up: I'm getting a weird error when trying to add any 3rd party lib (let's say react) to package.json using rush add --package react (for example). The error log:
Found configuration in /home/ivan/dev/JS/eisbuk/rush.json
Rush Multi-Project Build Tool 5.66.2 - https://rushjs.io
Node.js version is 14.19.0 (LTS)
Found configuration in /home/ivan/dev/JS/eisbuk/rush.json
Starting "rush add"
Determining new version for dependency: react
No version selector was specified, so the version will be determined automatically.
Trying to acquire lock for pnpm-6.32.3
Acquired lock for pnpm-6.32.3
Found pnpm version 6.32.3 in /home/ivan/.rush/node-v14.19.0/pnpm-6.32.3
Symlinking "/home/ivan/dev/JS/eisbuk/common/temp/pnpm-local" --> "/home/ivan/.rush/node-v14.19.0/pnpm-6.32.3"
The "ensureConsistentVersions" policy is NOT active, so we will assign the latest version.
Querying NPM registry for latest version of "react"...
ERROR: The command failed with exit code 243
I tried to find a similar problem report related to rush and looked up the 243 error with npm, both to no avail. I'm using pnpm, however, the error persists with npm and yarn all the same (with yarn it's exit code 1, everything else is the same).
Here's my .npmrc (a default really):
registry=https://registry.npmjs.org/
always-auth=false
Interestingly enough, if I manually add a dependency to package.json and run rush update, the update goes well and the dep is added to node_modules and shrinkwrap (so it shouldn't be an npm registry problem).
Here's my rush.json:
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json",
"rushVersion": "5.66.2",
"pnpmVersion": "6.32.3",
"pnpmOptions": {
"preventManualShrinkwrapChanges": true,
"useWorkspaces": true
},
"nodeSupportedVersionRange": ">=12.13.0 <13.0.0 || >=14.15.0 <15.0.0 || >=16.13.0 <17.0.0",
"gitPolicy": {},
"repository": {},
"eventHooks": {
"preRushInstall": [],
"postRushInstall": [],
"preRushBuild": [],
"postRushBuild": []
},
"variants": [],
"projects": [
/** ...other projects */
{
"packageName": "#eisbuk/functions",
"projectFolder": "packages/functions"
}
/** ...other projects */
]
}
The entire repo can be found at: https://github.com/eisbuk/EisBuk/tree/feature/rush
Solved!
In the end, I've managed to pinpoint it to the node version. I was using v14.19.0 and bumping to v16.14.2 solved it. I don't know if it's a known incompatibility, but here it is.

Is there a way to get the data that is returned by `npm view <package name>`, perhaps by an official api?

The data that is returned is in JSON format:
$ npm view react-router
{ name: 'react-router',
description: 'Declarative routing for React',
'dist-tags': { latest: '4.0.0', next: '4.0.0-beta.8', previous: '3.0.3' },
versions:
[ '0.0.0',
'0.0.1',
'0.4.0',
'0.4.1',
'0.4.2',
'0.5.0',
'0.5.1',
// ...
Is there an official api for this info? I saw one npm module called npm-web-api but don't see an official published API.
That information comes from the npm registry API (format); your example can be found at https://registry.npmjs.com/react-router.

Cannot generate new project using yeoman generator Gradle+Kotlin

I installed Android Studio on Mac using brew install Caskroom/cask/android-studio
Then, I run yo gradle-kotlin, and got the following error. What can I do to make my first Hello World work?
Thank you
✔ /Volumes/Git/android/kotlin-hello-world
10:53 $ yo gradle-kotlin
_-----_
| | .--------------------------.
|--(o)--| | Welcome to the |
`---------´ | incredible Gradle+Kotlin |
( _´U`_ ) | generator! |
/___A___\ '--------------------------'
| ~ |
__'.___.'__
´ ` |° ´ Y `
Detecting installed Gradle version...
Fetching latest Kotlin version from Maven Central...
✔ Fetched latest Kotlin version: 1.0.1-2
✔ Detected installed Gradle version: 2.12
? What's your project name? kotlin hello world
? What Gradle version would you like to use? 2.12
? What Kotlin version would you like to use? 1.0.1-2
? Do you want to use Kotlin Reflection? Yes
? Would you like to use IDEA Gradle plugin? Yes
identical .gitignore
identical src/main/kotlin/.gitkeep
identical src/test/kotlin/.gitkeep
identical build.gradle
identical gradle.properties
identical settings.gradle
Executing 'gradle wrapper' command...
✔ Done executing 'gradle wrapper' command.
Executing Gradle tasks: idea build
internal/child_process.js:298
throw errnoException(err, 'spawn');
^
Error: spawn EACCES
at exports._errnoException (util.js:856:11)
at ChildProcess.spawn (internal/child_process.js:298:11)
at Object.exports.spawn (child_process.js:362:9)
at Function.spawn (/usr/local/lib/node_modules/generator-gradle-kotlin/node_modules/cross-spawn-async/index.js:13:18)
at spawn (/usr/local/lib/node_modules/generator-gradle-kotlin/node_modules/cross-spawn/index.js:34:23)
at GradleKotlinGenerator.spawnCommand (/usr/local/lib/node_modules/generator-gradle-kotlin/node_modules/yeoman-generator/lib/actions/spawn_command.js:20:10)
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/generator-gradle-kotlin/generators/app/gradle-kotlin.coffee:78:8)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
I've just fixed it.
It was an OSX-specific bug in the generator logic, a rather stupid one: it incorrectly detected the platform and tried to call ./gradlew.bat, it didn't even realize it's a .bat file, the reason for EACCES error actually was that this .bat didn't have +x permission. Just update the generator to 1.1.1 and it should be fine.

Cannot generate new REST datasource with Strongloop

I'm new to Loopback, was following this page here: https://docs.strongloop.com/display/public/LB/REST+connector
$ npm install loopback-connector-rest --save
$ slc loopback:datasource
? Enter the data-source name: testrestDS
? Select the connector ...
> REST Services (supported by StrongLoop)
And then I get this error:
events.js:154
throw er; // Unhandled 'error' event
^
TypeError: Cannot set property 'facetName' of undefined
at exports._extend (util.js:770:21)
at module.exports.yeoman.generators.Base.extend.dataSource (/usr/lib/node_modules/strongloop/node_modules/generator-loopback/datasource/index.js:169:18)
at /usr/lib/node_modules/strongloop/node_modules/yeoman-generator/lib/base.js:430:16
at processImmediate [as _immediateCallback] (timers.js:383:17)
I've tried a couple other connector types in the generator and they work (like Mongo even though I don't have that connector installed).
Ubuntu 14.04 64-bit
node v5.7.1
npm v3.6.0
slc v6.0.0
loopback v2.27.0
loopback-connector-rest v1.10.2
I got the same error on my command line, but not in my Docker container based on the strongloop/node image.
In both cases strongloop v6.0.0 but on different versions of node (v0.10.25 versus v0.10.38 in the Docker container) with a different version of generator-loopback (1.16.2 versus 1.20.5 in the Docker container).
I suspect that you need to upgrade to resolve this issue.