Ionic 2: Cordova is not available. Make sure to include cordova.js or run in a device/simulator (running in emulator)

This is quite late but anyone going through the same problem might benefit from this answer.First try to add browser by running below command ionic platform add browser and then run command ionic run browser. which is the difference between ionic serve and ionic run browser? Ionic serve – runs your app as a website … Read more

Add Custom Icon in Ionic 2

This is the easiest way I’ve found, from the forums at https://forum.ionicframework.com/t/anyway-to-custom-the-tabbars-icon-with-my-own-svg-file/46131/36. In your app.scss file, add the following code: ion-icon { &[class*=”appname-“] { // Instead of using the font-based icons // We’re applying SVG masks mask-size: contain; mask-position: 50% 50%; mask-repeat: no-repeat; background: currentColor; width: 1em; height: 1em; } // custom icons &[class*=”appname-customicon1”] { … Read more

Cannot find namespace NodeJS when using NodeJS.Timer in Ionic 2

Open src/tsconfig.app.json*. Add “node” to the “types” array. Example: { “extends”: “../tsconfig.json”, “compilerOptions”: { “outDir”: “../out-tsc/app”, “baseUrl”: “./”, “module”: “es2015”, “types”: [ “node” ] }, “exclude”: [ “test.ts”, “**/*.spec.ts” ] } *if this file does not exist add the specified part to tsconfig.json in root folder.

Content Security Policy: “img-src ‘self’ data:”

Try replacing this part: img-src * ‘self’ data: https:; So the complete tag: <meta http-equiv=”Content-Security-Policy” content=”default-src *; img-src * ‘self’ data: https:; script-src ‘self’ ‘unsafe-inline’ ‘unsafe-eval’ *; style-src ‘self’ ‘unsafe-inline’ *”> Content Security Policy Reference