Hi team,
I'm trying to display a map in an Angular app as a component. I'm struggling to make it work because the map doesn't appear never. The code It's quite simple becacause I'm following the example of this repository: https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-angular-cli using ES modules.
My package.json is this:
{
"name": "siginter4clientweb-front",
"version": "0.0.1",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"pwa-asset-generator": "pwa-asset-generator -c -f src/assets/images/app-icon.png src/assets/images"
},
"private": true,
"dependencies": {
"@angular/animations": "~12.2.8",
"@angular/common": "~12.2.8",
"@angular/compiler": "~12.2.8",
"@angular/core": "~12.2.8",
"@angular/flex-layout": "^12.0.0-beta.35",
"@angular/forms": "~12.2.8",
"@angular/material": "^12.2.8",
"@angular/platform-browser": "~12.2.8",
"@angular/platform-browser-dynamic": "~12.2.8",
"@angular/router": "~12.2.8",
"@angular/service-worker": "~12.2.8",
"@arcgis/core": "^4.23.1",
"@jccm/marco": "^2.0.0-alpha.43",
"@ngneat/transloco": "^2.22.0",
"keycloak-angular": "^8.3.0",
"keycloak-js": "^10.0.2",
"ngx-avatar": "^4.1.0",
"rxjs": "~6.6.0",
"tslib": "^2.3.0",
"xstate": "^4.23.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.2.7",
"@angular/cdk": "^12.2.8",
"@angular/cli": "~12.2.7",
"@angular/compiler-cli": "~12.2.8",
"@cypress/schematic": "^1.5.0",
"@types/arcgis-js-api": "^4.23.0",
"@types/node": "^12.11.1",
"cypress": "8.3.1",
"cypress-plugin-snapshots": "^1.4.4",
"pwa-asset-generator": "^4.3.9",
"typescript": "~4.3.5"
},
"optionalDependencies": {
"fsevents": "^2.3.2"
}
}
Angular.json:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"analytics": false
},
"version": 1,
"newProjectRoot": "projects",
"projects": {
"siginter4clientweb": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
},
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "node_modules/@jccm/marco/src/lib/assets/html/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "sass",
"assets": [
"src/favicon.ico",
"src/assets",
{
"glob": "*",
"input": "node_modules/@arcgis/core/assets/esri/themes/light",
"output": ""
},
{
"glob": "*",
"input": "node_modules/@jccm/marco/src/lib/assets/html",
"output": ""
},
"src/manifest.webmanifest"
],
"styles": ["src/styles.scss"],
"scripts": [],
"preserveSymlinks": true,
"allowedCommonJsDependencies": ["keycloak-js"],
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "1500kb",
"maximumError": "2000kb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.dev.ts"
}
]
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "siginter4clientweb:build:production"
},
"development": {
"browserTarget": "siginter4clientweb:build:development"
}
},
"defaultConfiguration": "development"
},
"cypress-run": {
"builder": "@cypress/schematic:cypress",
"options": {
"devServerTarget": "siginter4clientweb:serve"
},
"configurations": {
"production": {
"devServerTarget": "siginter4clientweb:serve:production"
}
}
},
"cypress-open": {
"builder": "@cypress/schematic:cypress",
"options": {
"watch": true,
"headless": false
}
},
"e2e": {
"builder": "@cypress/schematic:cypress",
"options": {
"devServerTarget": "siginter4clientweb:serve",
"watch": true,
"headless": false
},
"configurations": {
"production": {
"devServerTarget": "siginter4clientweb:serve:production"
}
}
}
}
}
},
"defaultProject": "siginter4clientweb"
}
tsconfig.json:
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2017",
"module": "es2020",
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}