Scss files are not compiled as css file in ionic 5 - css

I am using ionic 5 with angular 8 in my project. I have introduced Sass variables SCSS files which is not getting converted into CSS. I can see only SCSS file compiled while serving with ionic serve command.
What am I doing wrong here? How to compile SCSS into CSS in live reload always. Please suggest a way. Thanks in advance.
$secondary-color: #162a38;
$base-color: #407294;
.custom-alert .alert-input {
color: $base-color !important;
}
My package.json look like below:
"dependencies":
"#angular/common": "~8.1.2",
"#angular/core": "~8.1.2",
"#angular/fire": "^5.2.3",
"#angular/forms": "~8.1.2",
"#angular/platform-browser": "~8.1.2",
"#angular/platform-browser-dynamic": "~8.1.2",
"#angular/router": "~8.1.2",
"#fortawesome/angular-fontawesome": "^0.5.0",
"#fortawesome/fontawesome-svg-core": "^1.2.32",
"#fortawesome/free-brands-svg-icons": "^5.15.1",
"#fortawesome/free-regular-svg-icons": "^5.15.1",
"#fortawesome/free-solid-svg-icons": "^5.15.1",
"#ionic-native/base64": "^5.29.0",
"#ionic-native/core": "^5.0.0",
"#ionic-native/file": "^5.29.0",
"#ionic-native/file-chooser": "^5.29.0",
"#ionic-native/file-path": "^5.29.0",
"#ionic-native/splash-screen": "^5.0.0",
"#ionic-native/status-bar": "^5.0.0",
"#ionic/angular": "^5.4.0",
"#ionic/core": "5.4.0",
"#ionic/storage": "^2.2.0",
"#types/jquery": "^3.5.1",
"com-badrit-base64": "^0.2.0",
"cordova": "^9.0.0",
"cordova-android": "8.1.0",
"cordova-ios": "5.1.0",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-filechooser": "^1.2.0",
"cordova-plugin-filepath": "^1.5.8",
"cordova-sqlite-storage": "^4.0.0",
"core-js": "^2.5.4",
"fast-glob": "^3.2.4",
"firebase": "^7.6.1",
"ionicons": "^5.2.3",
"jquery": "^3.5.1",
"lodash": "^4.17.20",
"ngx-quill": "^12.0.1",
"npm": "^6.13.4",
"quill": "^1.3.7",
"rxjs": "~6.5.1",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
"devDependencies":
"#angular-devkit/architect": "~0.801.2",
"#angular-devkit/build-angular": "~0.801.2",
"#angular-devkit/core": "~8.1.2",
"#angular-devkit/schematics": "~8.1.2",
"#angular/cli": "~8.1.2",
"#angular/compiler": "~8.1.2",
"#angular/compiler-cli": "~8.1.2",
"#angular/language-service": "~8.1.2",
"#ionic-native/camera": "^5.19.0",
"#ionic/angular-toolkit": "^2.1.1",
"#types/jasmine": "~3.3.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.1.3",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.4.3"
My angular.json build scripts looks like below:
"build": {
"builder": "#angular-devkit/build-angular:browser",
"options": {
"outputPath": "www",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "src/assets",
"output": "assets"
},
{
"glob": "**/*.svg",
"input": "node_modules/ionicons/dist/ionicons/svg",
"output": "./svg"
}
],
"styles": [
{
"input": "src/theme/variables.scss"
},
{
"input": "src/global.scss"
}
],
"scripts": []
},

Related

Upgraded Angular 7 to 11 after that #hallysonh/ngx-imageviewer next, previous and zoom options are not working

I upgrade Angular 7 to 11 after that #hallysonh/ngx-imageviewer#2.0.4 (next, previous and zoom) options are not working. I tried with both node 12.20.0 and 14.15.0.I'm able to view the pdfthese buttons but previous, next, zoom buttons are not working. nothing is happening while clicking it. I guess my pdfjs-dist#2.0.489 is not compatible with Angular 11. May I know the pdfjs-dist suitable version for Angular11?
"dependencies": {
"#angular/animations": "^11.2.14",
"#angular/cdk": "^11.2.13",
"#angular/common": "~11.2.14",
"#angular/compiler": "~11.2.14",
"#angular/core": "~11.2.14",
"#angular/forms": "~11.2.14",
"#angular/material": "^11.2.13",
"#angular/platform-browser": "~11.2.14",
"#angular/platform-browser-dynamic": "~11.2.14",
"#angular/router": "~11.2.14",
"#hallysonh/ngx-imageviewer": "^2.0.4",
"#stomp/stompjs": "^4.0.7",
"#types/bootstrap": "^4.2.0",
"#types/highcharts": "^5.0.36",
"#types/jquery": "^3.3.29",
"#types/node": "^12.11.1",
"angular-user-idle": "^2.2.1",
"angular2-tree-diagram": "^1.0.6",
"bootstrap": "^4.1.3",
"core-js": "2.5.4",
"d3": "^5.7.0",
"file-saver": "^1.3.3",
"font-awesome": "^4.7.0",
"fscreen": "^1.0.2",
"hammerjs": "^2.0.8",
"highcharts": "^7.0.3",
"highcharts-angular": "^2.4.0",
"jquery": "^3.3.1",
"material-design-icons": "^3.0.1",
"moment": "^2.23.0",
"moment-timezone": "^0.5.23",
"ng-sidebar": "^8.0.0",
"ng2-ace-editor": "^0.3.9",
"pdfjs-dist": "^2.0.489",
"popper.js": "^1.14.5",
"print-js": "1.0.47",
"proj4": "^2.5.0",
"rxjs": "~6.6.7",
"sockjs-client": "^1.3.0",
"tslib": "^2.3.1",
"zone.js": "~0.10.2"
},
"devDependencies": {
"#angular-devkit/build-angular": "~0.1102.18",
"#angular/cli": "~11.2.18",
"#angular/compiler-cli": "~11.2.14",
"#angular/language-service": "~11.2.14",
"#types/jasmine": "~3.6.0",
"#types/jasminewd2": "~2.0.3",
"codelyzer": "^6.0.0",
"glob-run": "^0.1.7",
"husky": "^4.2.5",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"js-beautify": "^1.11.0",
"karma": "~6.3.16",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"lint-staged": "^10.2.9",
"prettier": "^2.0.5",
"protractor": "~7.0.0",
"ts-node": "~7.0.0",
"tslint": "~6.1.0",
"tslint-sonarts": "^1.9.0",
"typescript": "~4.0.8"
}
}

Angular 12 data binding problems

I have a project migrated to angular 12.2 with the package.json file configured like this:
{
"name": "xxxx",
"version": "1",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"#agm/core": "^3.0.0-beta.0",
"#angular-slider/ngx-slider": "^2.0.3",
"#angular/animations": "~12.2.0",
"#angular/cdk": "^12.2.11",
"#angular/common": "~12.2.0",
"#angular/compiler": "~12.2.0",
"#angular/core": "~12.2.0",
"#angular/forms": "~12.2.0",
"#angular/platform-browser": "~12.2.0",
"#angular/platform-browser-dynamic": "~12.2.0",
"#angular/router": "~12.2.0",
"#angularclass/hmr": "^3.0.0",
"#ngx-translate/core": "^13.0.0",
"#ngx-translate/http-loader": "^6.0.0",
"#types/geojson": "^7946.0.8",
"#types/googlemaps": "^3.39.12",
"angular-2-local-storage": "^3.0.2",
"angular2-highcharts": "^0.5.5",
"angular2-query-builder": "^0.6.2",
"animate.css": "^4.1.1",
"chart.js": "^3.6.0",
"core-js": "^3.19.0",
"d3-array": "^3.1.1",
"file-saver": "^2.0.5",
"font-awesome": "^4.7.0",
"fullcalendar": "^5.10.0",
"geojson": "^0.5.0",
"gzip-all": "^1.0.0",
"highcharts": "^9.3.0",
"jexl": "^2.3.0",
"jquery": "^3.6.0",
"jsbarcode": "^3.11.5",
"moment": "^2.29.1",
"nanoscroller": "^0.8.7",
"ng2-dragula": "^2.1.1",
"ngx-localized-numbers": "^0.4.1",
"ngx-schema-form": "^2.6.6",
"node-sass": "^6.0.1",
"pg": "^8.7.1",
"primeicons": "^4.1.0",
"primeng": "^12.2.1",
"quill": "^1.3.7",
"rxjs": "~6.6.0",
"ts-helpers": "^1.1.2",
"tslib": "^2.3.0",
"typescript": "^4.2.4",
"uuid": "^8.3.2",
"venn.js": "^0.2.20",
"xlsx": "^0.17.3",
"z-schema": "^4.2.4",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "~12.2.11",
"#angular/cli": "~12.2.11",
"#angular/compiler-cli": "~12.2.0",
"#angular/language-service": "^12.2.11",
"#types/angular": "^1.8.3",
"#types/jasmine": "~3.8.0",
"#types/jasminewd2": "^2.0.10",
"#types/jquery": "^3.5.8",
"#types/node": "^12.20.36",
"codelyzer": "^6.0.2",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "^7.0.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"protractor": "^7.0.0",
"ts-node": "^10.4.0"
}
}
The tsconfig.app.json file is configured like this:
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": ["googlemaps","jquery","node"]
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
}
The tsconfig.json file is configured like this:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es2018","dom"],
"module": "es2020",
"moduleResolution": "node",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"target": "es2017",
"typeRoots": ["./node_modules/#types"]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true,
//"enableIvy": false,
"strictDomEventTypes": false
}
}
Unfortunately, no data binding is done on any variable of any view, why?
I am using the same configuration on an angular 10 project and everything works fine.
Thanks.
At this time I solved it like this:
example I replaced {{variable}} with <span [innerText]="variable"></span>
However I didn't understand why I can't use {{variable}} syntax ... I hope someone can help me.
Thanks.

How to setup storybook on an existing project

I've tried this. npx -p #storybook/cli sb init --type angular, on an existing project but fails with.
And dependancies look like :
"dependencies": {
"#angular/animations": "^9.0.6",
"#angular/cdk": "^9.1.2",
"#angular/common": "^9.0.6",
"#angular/compiler": "^9.0.6",
"#angular/core": "^9.0.6",
"#angular/forms": "^9.0.6",
"#angular/http": "^7.2.16",
"#angular/localize": "^9.0.6",
"#angular/material": "^9.1.2",
"#angular/platform-browser": "^9.0.6",
"#angular/platform-browser-dynamic": "^9.0.6",
"#angular/platform-server": "^9.0.6",
"#angular/router": "^9.0.6",
"#ng-bootstrap/ng-bootstrap": "^6.0.0",
"#nguniversal/express-engine": "^9.0.2",
"#nguniversal/module-map-ngfactory-loader": "^8.2.6",
"#swimlane/ngx-charts": "^13.0.2",
"#types/lodash": "^4.14.149",
"angular2-prettyjson": "^3.0.1",
"angularfire2": "^5.4.2",
"angularx-qrcode": "^2.1.1",
"archiver": "^3.1.1",
"body-scroll-lock": "^2.6.4",
"bootstrap": "^4.4.1",
"core-js": "^3.6.4",
"firebase": "^7.11.0",
"hammerjs": "^2.0.8",
"jquery": "^3.4.1",
"jquery-ui": "^1.12.1",
"localforage": "^1.7.3",
"lodash": "^4.17.15",
"marked": "^1.1.0",
"moment": "^2.24.0",
"open-graph": "^0.2.4",
"rxjs": "^6.5.4",
"scss": "^0.2.4",
"ts-loader": "^6.2.1",
"ts-transformer-keys": "^0.4.1",
"turndown": "^6.0.0",
"underscore.string": "^3.3.5",
"zip-local": "^0.3.4",
"zone.js": "^0.10.2"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.900.6",
"#angular/cli": "^9.0.6",
"#angular/compiler-cli": "^9.0.6",
"#angular/language-service": "^9.0.6",
"#babel/core": "^7.10.4",
"#storybook/addon-actions": "^5.3.19",
"#storybook/addon-links": "^5.3.19",
"#storybook/addon-notes": "^5.3.19",
"#storybook/addons": "^5.3.19",
"#storybook/angular": "^5.3.19",
"#types/bootstrap": "^4.3.1",
"#types/jasmine": "^3.5.9",
"#types/jasminewd2": "^2.0.8",
"#types/jquery": "^3.3.33",
"#types/node": "^13.9.1",
"babel-loader": "^8.1.0",
"browser-sync": "^2.26.7",
"codelyzer": "~5.2.1",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^4.4.1",
"karma-chrome-launcher": "~3.1.0",
"karma-cli": "~2.0.0",
"karma-coverage-istanbul-reporter": "^2.1.1",
"karma-jasmine": "~3.1.1",
"karma-jasmine-html-reporter": "^1.5.2",
"node-sass": "^4.13.1",
"protractor": "~5.4.3",
"ts-node": "~8.6.2",
"tslint": "^6.1.1",
"typescript": "~3.7.5"
}
}
I've also tried removing node modules and installing again, it just comes back here.
it looks like there are 2 '}'s at the end, is that intentional? if not try removing one of them.

Firebase has no exported member promise

It was working fine without any issues. I tried to update the "#ionic-native/core": "3.12.1" to latest and then rolled back the version after that i am getting this error. Can somebody please let me know if there is any version mismatch ? Thank you.
"dependencies": {
"#angular/common": "4.1.3",
"#angular/compiler": "4.1.3",
"#angular/compiler-cli": "4.1.3",
"#angular/core": "4.1.3",
"#angular/forms": "4.1.3",
"#angular/http": "4.1.3",
"#angular/platform-browser": "4.1.3",
"#angular/platform-browser-dynamic": "4.1.3",
"#ionic-native/barcode-scanner": "^4.4.0",
"#ionic-native/camera": "^4.4.2",
"#ionic-native/core": "3.12.1",
"#ionic-native/device": "^4.6.0",
"#ionic-native/fcm": "^4.6.0",
"#ionic-native/geolocation": "^4.4.2",
"#ionic-native/google-plus": "^4.6.0",
"#ionic-native/photo-library": "^4.4.2",
"#ionic-native/printer": "^4.6.0",
"#ionic-native/push": "^4.6.0",
"#ionic-native/splash-screen": "3.12.1",
"#ionic-native/status-bar": "3.12.1",
"#ionic/storage": "2.0.1",
"angular2-signaturepad": "^2.8.0",
"angularfire2": "^4.0.0-rc0",
"chart.js": "^2.7.1",
"cordova-android": "^7.0.0",
"cordova-ios": "^4.5.4",
"cordova-plugin-add-swift-support": "^1.6.0",
"cordova-plugin-camera": "^3.0.0",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.0.5",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-fcm": "^2.1.2",
"cordova-plugin-file": "^4.3.2",
"cordova-plugin-geolocation": "^3.0.0",
"cordova-plugin-googleplus": "^5.2.1",
"cordova-plugin-photo-library": "^2.1.0",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.2.2",
"cordova-plugin-whitelist": "^1.3.1",
"firebase": "^4.6.2",
"font-awesome": "4.7.0",
"ionic-angular": "3.6.0",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"phonegap-plugin-barcodescanner": "^7.0.0",
"phonegap-plugin-push": "^2.2.2",
"rxjs": "5.4.0",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.12"
},
"devDependencies": {
"#angular/cli": "^1.2.7",
"#ionic/app-scripts": "2.1.3",
"#ionic/cli-plugin-cordova": "1.6.2",
"ionic": "3.7.0",
"typescript": "2.3.4"
},
Downgraded my firebase version to 3.9.* it worked.

cannot find module '#angular/core' visual studio 2017

I am new to angular + asp.net core
i am create sample project of angular 4 with .net core
but it keepshowing dependencies not installed
visual studio 15.5.2
Typescript version 2.6.2
Microsoft Typescript sdk 2.6.2
npm version 5.5.1
in my other machine its work perfectly but not in this pc
please help!!
MY package.json file is below
{
"name": "Angular_CRUD",
"private": true,
"version": "0.0.0",
"scripts": {
"test": "karma start ClientApp/test/karma.conf.js"
},
"devDependencies": {
"#angular/animations": "4.2.5",
"#angular/common": "4.2.5",
"#angular/compiler": "4.2.5",
"#angular/compiler-cli": "4.2.5",
"#angular/core": "4.2.5",
"#angular/forms": "4.2.5",
"#angular/http": "4.2.5",
"#angular/platform-browser": "4.2.5",
"#angular/platform-browser-dynamic": "4.2.5",
"#angular/platform-server": "4.2.5",
"#angular/router": "4.2.5",
"#ngtools/webpack": "1.5.0",
"#types/chai": "4.0.1",
"#types/jasmine": "2.5.53",
"#types/webpack-env": "1.13.0",
"angular2-router-loader": "0.3.5",
"angular2-template-loader": "0.6.2",
"aspnet-prerendering": "^3.0.1",
"aspnet-webpack": "^2.0.1",
"awesome-typescript-loader": "3.2.1",
"bootstrap": "3.3.7",
"chai": "4.0.2",
"css": "2.2.1",
"css-loader": "0.28.4",
"es6-shim": "0.35.3",
"event-source-polyfill": "0.0.9",
"expose-loader": "0.7.3",
"extract-text-webpack-plugin": "2.1.2",
"file-loader": "0.11.2",
"html-loader": "0.4.5",
"isomorphic-fetch": "2.2.1",
"jasmine-core": "2.6.4",
"jquery": "3.2.1",
"json-loader": "0.5.4",
"karma": "1.7.0",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-jasmine": "1.1.0",
"karma-webpack": "2.0.3",
"preboot": "4.5.2",
"raw-loader": "0.5.1",
"reflect-metadata": "0.1.10",
"rxjs": "5.4.2",
"style-loader": "0.18.2",
"to-string-loader": "1.1.5",
"typescript": "2.4.1",
"url-loader": "0.5.9",
"webpack": "2.5.1",
"webpack-hot-middleware": "2.18.2",
"webpack-merge": "4.1.0",
"zone.js": "0.8.12"
}
}
Run
npm install inside the folder to install the dependencies.
If this does not work, remove package-lock.json and try again

Resources