Basic adding of angular/material fails with Angular 6 - angular-material-6

I simply do the following:
ng new my-proj
cd my-proj
ng add #angular/material
I get in response the following error:
Your project is not using the default configuration for build and test.
The Angular Material schematics can only be used with the default
configuration
Seriously?? Anyone else?
Config:
Package Version
-----------------------------------------------------------
#angular-devkit/architect 0.8.1
#angular-devkit/build-angular 0.8.1
#angular-devkit/build-optimizer 0.8.1
#angular-devkit/build-webpack 0.8.1
#angular-devkit/core 0.8.1
#angular-devkit/schematics 0.8.1
#angular/cli 6.2.1
#angular/material 6.4.7
#ngtools/webpack 6.2.1
#schematics/angular 0.8.1
#schematics/update 0.8.1
rxjs 6.2.2
typescript 2.9.2
webpack 4.19.0

Related

Gmaps Not working with Jupyter Labs - Error: No provider for: jupyter.extensions.jupyterWidgetRegistry

Gmaps works with Jupyter notebook but with a nearly identical setup and with jupyter lab it fails to work. I have installed, done build and have all the basic extensions as I show in screenshots . I have seen one other thread on similar issue but it doesnt solve my problem, i have put all information about extensions and other conda env below.
(regtest) ➜ ~ jupyter nbextension list
Known nbextensions:
config dir: /Users/somghosh/miniconda3/envs/regtest/etc/jupyter/nbconfig
notebook section
jupyter-js-widgets/extension enabled
- Validating: OK
jupyter-gmaps/extension enabled
- Validating: OK
(regtest) ➜ ~ jupyter labextension list
JupyterLab v1.0.1
Known labextensions:
app dir: /Users/somghosh/miniconda3/envs/regtest/share/jupyter/lab
#jupyter-widgets/jupyterlab-manager v1.0.0 enabled OK
jupyter-gmaps v0.8.4 enabled OK
(regtest) ➜ ~ conda info
active environment : regtest
active env location : /Users/somghosh/miniconda3/envs/regtest
shell level : 2
user config file : /Users/somghosh/.condarc
populated config files : /Users/somghosh/miniconda3/envs/regtest/.condarc
conda version : 4.7.5
conda-build version : not installed
python version : 3.7.3.final.0
virtual packages :
base environment : /Users/somghosh/miniconda3 (writable)
channel URLs : https://conda.anaconda.org/conda-forge/osx-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/main/osx-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/osx-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /Users/somghosh/miniconda3/pkgs
/Users/somghosh/.conda/pkgs
envs directories : /Users/somghosh/miniconda3/envs
/Users/somghosh/.conda/envs
platform : osx-64
user-agent : conda/4.7.5 requests/2.21.0 CPython/3.7.3 Darwin/18.5.0 OSX/10.14.4
UID:GID : 502:20
netrc file : None
offline mode : False
(regtest) ➜ ~ conda list
# packages in environment at /Users/somghosh/miniconda3/envs/regtest:
#
# Name Version Build Channel
appnope 0.1.0 py37_1000 conda-forge
attrs 19.1.0 py_0 conda-forge
backcall 0.1.0 py_0 conda-forge
bleach 3.1.0 py_0 conda-forge
ca-certificates 2019.6.16 hecc5488_0 conda-forge
certifi 2019.6.16 py37_0 conda-forge
decorator 4.4.0 py_0 conda-forge
defusedxml 0.5.0 py_1 conda-forge
entrypoints 0.3 py37_1000 conda-forge
geojson 2.4.1 py_0 conda-forge
gmaps 0.8.4 py_0 conda-forge
ipykernel 5.1.1 py37h24bf2e0_0 conda-forge
ipython 7.6.1 py37h5ca1d4c_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.5.0 py_0 conda-forge
jedi 0.14.0 py37_0 conda-forge
jinja2 2.10.1 py_0 conda-forge
json5 0.8.4 py_0 conda-forge
jsonschema 3.0.1 py37_0 conda-forge
jupyter_client 5.2.4 py_3 conda-forge
jupyter_core 4.4.0 py_0 conda-forge
jupyterlab 1.0.1 py37_0 conda-forge
jupyterlab_server 1.0.0 py_1 conda-forge
libcxx 4.0.1 hcfea43d_1
libcxxabi 4.0.1 hcfea43d_1
libedit 3.1.20181209 hb402a30_0
libffi 3.2.1 h475c297_4
libsodium 1.0.16 h1de35cc_1001 conda-forge
markupsafe 1.1.1 py37h1de35cc_0 conda-forge
mistune 0.8.4 py37h1de35cc_1000 conda-forge
nbconvert 5.5.0 py_0 conda-forge
nbformat 4.4.0 py_1 conda-forge
ncurses 6.1 h0a44026_1
notebook 5.7.8 py37_1 conda-forge
openssl 1.1.1b h01d97ff_2 conda-forge
pandoc 2.7.3 0 conda-forge
pandocfilters 1.4.2 py_1 conda-forge
parso 0.5.0 py_0 conda-forge
pexpect 4.7.0 py37_0 conda-forge
pickleshare 0.7.5 py37_1000 conda-forge
pip 19.1.1 py37_0
prometheus_client 0.7.1 py_0 conda-forge
prompt_toolkit 2.0.9 py_0 conda-forge
ptyprocess 0.6.0 py_1001 conda-forge
pygments 2.4.2 py_0 conda-forge
pyrsistent 0.15.2 py37h01d97ff_0 conda-forge
python 3.7.3 h359304d_0
python-dateutil 2.8.0 py_0 conda-forge
pyzmq 18.0.2 py37h2d07e9b_0 conda-forge
readline 7.0 h1de35cc_5
send2trash 1.5.0 py_0 conda-forge
setuptools 41.0.1 py37_0
six 1.12.0 py37_1000 conda-forge
sqlite 3.28.0 ha441bb4_0
terminado 0.8.2 py37_0 conda-forge
testpath 0.4.2 py_1001 conda-forge
tk 8.6.8 ha441bb4_0
tornado 6.0.3 py37h01d97ff_0 conda-forge
traitlets 4.3.2 py37_1000 conda-forge
wcwidth 0.1.7 py_1 conda-forge
webencodings 0.5.1 py_1 conda-forge
wheel 0.33.4 py37_0
widgetsnbextension 3.5.0 py37_0 conda-forge
xz 5.2.4 h1de35cc_4
zeromq 4.3.1 h0a44026_1000 conda-forge
zlib 1.2.11 h1de35cc_3
Code in pic is as below
import ipywidgets
ipywidgets.IntSlider()
locations = [(51.45681, -0.11717),
(51.49119, -0.07177),
(51.51439, -0.13108),
(51.54591, -0.15607)]
import gmaps
import gmaps.datasets
gmaps.configure(api_key=API_KEY) # Your Google API key
fig = gmaps.figure()
heatmap_layer = gmaps.heatmap_layer(locations)
fig.add_layer(heatmap_layer)
fig
print(gmaps.__version__); print(ipywidgets.__version__)
Sadly, not every Jupyter Notebook extension works also with JupyterLab. The reason for that is that the underlying software architecture is quite different, and therefore the code for the Jupyter Notebook extensions leads to errors when running on JupyterLab. For further information on the extensions for JupyterLab you can have a look at the documentation.
I could not find an official JupyterLab extension for gmaps now, but maybe you can find an alternative in the recommended list of JupyterLab extensions.

Upgrading ngx-bootstrap 3.0.1 to 4.0.1

While Upgrading from ngx bootstrap 3.0.1 to 4.0.1 am getting the following error.Replaced the node_modules, package.json still getting the same errors.
Angular Version :
Angular 6,
Typescript: 2.7.2.
Errors:
ERROR in node_modules/ngx-bootstrap/chronos/utils/type-checks.d.ts(8,62): error TS2304: Cannot find name 'Extract'.
node_modules/ngx-bootstrap/datepicker/reducer/bs-datepicker.actions.d.ts(5,33): error TS1039: Initializers are not allowed in ambient contexts.
node_modules/ngx-bootstrap/timepicker/reducer/bs-datepicker.actions.d.ts(4,33): error TS1039: Initializers are not allowed in ambient contexts.
Errors in the image
I have encounter this error when I was using ngx-editor to implement rich text editor in Angular
This error occurs due to older version of Angular and rxjs, In my case I was using Angular 6 and rxjs 6.0.0, then I have updated it to Angular 7 and rxjs 6.2.0 by using below commands (Typescript will also be updated to typescript 2.9.2)
ng update rxjs#~6.2.0
ng update #angular/cli #angular/core
Note: If you are getting below warning
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
and you want to ignore this warning (fsevents#1.2.7:) you can use below command
npm i -f
After this, I have uninstall ngx-bootstrap and ngx-editor, then first install dependency packages and then reinstall ngx-bootstrap and ngx-editor, as mentioned below steps.
npm i ajv#^6.9.1 --save
npm i font-awesome#^4.7.0 --save
npm i angular-font-awesome
npm install ngx-bootstrap --save
npm install ngx-editor --save
At last, you need to check if HttpClientModule and other packages are properly imported in app.module.ts
import { NgxEditorModule } from 'ngx-editor';
import { AngularFontAwesomeModule } from 'angular-font-awesome';
import { TooltipModule } from 'ngx-bootstrap/tooltip';
import { HttpClientModule } from '#angular/common/http';
imports: [
BrowserModule,
AppRoutingModule,
NgxEditorModule,
AngularFontAwesomeModule,
TooltipModule.forRoot(),
HttpClientModule
],
Now it is resolved, In addition you can able to use rich text editor by using ngx-editor
Thanks
the Solution for this error is the same to the above, change the followings versions in package.json.
"bootstrap": "4.1.3",
"font-awesome": "4.7.0",
"ngx-bootstrap": "3.1.1",
"ngx-editor": "4.0.0",
"rxjs": "6.3.3",
remove the node_module and package-lock.json and than install npm:
npm install.
Fix it in files
"\node_modules\ngx-bootstrap\datepicker\reducer\bs-datepicker.actions.d.ts"
From
static readonly CALCULATE = "[datepicker] calculate dates matrix";
To
static readonly CALCULATE : "[datepicker] calculate dates matrix";
Solution for this error is change the Bootstrap version (4.0.0 to 3.0.0) and remove the ^ in package.json (i.e "rxjs": "^6.0.0" to "rxjs": "6.0.0", and "rxjs-compat": "^6.2.2" to "rxjs-compat": "6.2.2",).
if you want bootstrap 4 version than try to change the rxjs and rxjs-compat (As i inform in above line).and remove the node_module and package-lock.json and than install npm.

Cordova fails on a fresh Mojave installation

I installed a fresh Mojave to find this error with my build and I am not sure how to debug this, seems it's coming out of
cordova-plugin-googlemaps/PluginLocationService.m
cordova run ios --debug --verbose
The following build commands failed:
CompileC /Users/me/Library/Developer/Xcode/DerivedData/app-bdpokdmgnlhxvrfpkwhgoykdgckc/Build/Intermediates.noindex/app.build/Debug-iphonesimulator/app.build/Objects-normal/x86_64/PluginCircle.o app/Plugins/cordova-plugin-googlemaps/PluginCircle.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/me/Library/Developer/Xcode/DerivedData/app-bdpokdmgnlhxvrfpkwhgoykdgckc/Build/Intermediates.noindex/app.build/Debug-iphonesimulator/app.build/Objects-normal/x86_64/PluginLocationService.o app/Plugins/cordova-plugin-googlemaps/PluginLocationService.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
CordovaError: Promise rejected with non-error: 'Error code 65 for command: xcodebuild with args: -xcconfig,/Users/me/Documents/app/platforms/ios/cordova/build-debug.xcconfig,-workspace,app.xcworkspace,-scheme,app,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone X,build,CONFIGURATION_BUILD_DIR=/Users/me/Documents/app/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/me/Documents/app/platforms/ios/build/sharedpch'
ionic info
Ionic:
ionic (Ionic CLI) : 4.10.3
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib#8.1.1)
Cordova Platforms : ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 9 other plugins)
System:
NodeJS : v11.10.0 (/Users/me/.nvm/versions/node/v11.10.0/bin/node)
npm : 6.7.0
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61
Solution - install missing CocoaPods
cd platform/ios
pod install

"ng generate application xyz" CLI not woking

I am trying to add an application to existing project but it's failing when running "ng generate application xyz". Error is:
Schematic input does not validate against the Schema: {"sourceDir":"app","prefix":"app","style":"css","theme":true,"webpack":true}
Errors:
Data path "" should have required property 'name'.
I then used "ng generate application --name=xyz" and the full blown subproject was created but I get the error when I run "ng serve xyz" which says "Project 'xyz' could not be found in workspace.". I Googled but I found nothing matching my problem. All examples generate libraries but I want to generate application not library.
Do I need to manually add the newly generated sub project settings to parent angular.json file?
ng -v
Angular CLI: 6.1.5
Node: 8.11.3
OS: win32 x64
Angular: 6.1.6
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
#angular-devkit/architect 0.7.5
#angular-devkit/build-angular 0.7.5
#angular-devkit/build-optimizer 0.7.5
#angular-devkit/build-webpack 0.7.5
#angular-devkit/core 0.7.5
#angular-devkit/schematics 0.7.5
#angular/cli 6.1.5
#ngtools/webpack 6.1.5
#schematics/angular 0.7.5
#schematics/update 0.7.5
rxjs 6.3.1
typescript 2.7.2
webpack 4.9.2
According to this you need to add a --name flag in the older version of the cli.
ng generate application --name xyz
And it seems to be a fixed issue.

PrimeNG p-message severity icon covers message (Angular 6 / PrimeIcons)

As shown below, the severity icon on the message box covers the actual message. Has anyone else experienced this and/or knows of a way to resolve it (in a manner that doesn't require hacking on the source code)? Thank you.
Versions:
"primeicons": "1.0.0-beta.10",
"primeng": "6.1.0",
Angular CLI: 6.0.8
Node: 8.9.4
OS: win32 x64
Angular: 6.1.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
#angular-devkit/architect 0.6.8
#angular-devkit/build-angular 0.7.2
#angular-devkit/build-optimizer 0.7.2
#angular-devkit/build-webpack 0.7.2
#angular-devkit/core 0.6.8
#angular-devkit/schematics 0.6.8
#angular/cli 6.0.8
#ngtools/webpack 6.1.2
#schematics/angular 0.6.8
#schematics/update 0.6.8
rxjs 6.2.2
typescript 2.7.2
webpack 4.9.2