Skip to content

Commit

Permalink
feat: update to Angular 17 (#224)
Browse files Browse the repository at this point in the history
* feat: update to Angular 17

* docs: update README.md
  • Loading branch information
ddubrava committed Nov 11, 2023
1 parent c5e0aca commit bebaf67
Show file tree
Hide file tree
Showing 9 changed files with 3,244 additions and 3,518 deletions.
68 changes: 62 additions & 6 deletions README.md
Expand Up @@ -31,7 +31,7 @@ npm install angular8-yandex-maps

| Angular version | Library version |
| ---------------------- | --------------- |
| v16 | v16.x |
| v16, v17 | v17.x |
| v15 | v15.x |
| v14 | v14.x |
| v9, v10, v11, v12, v13 | v13.x |
Expand All @@ -45,9 +45,11 @@ npm install angular8-yandex-maps@^8.0.0

## Usage

### app.module.ts
### SCAM

##### Default map config options
#### app.module.ts

###### Default map config options

```typescript
import { AngularYandexMapsModule } from 'angular8-yandex-maps';
Expand All @@ -58,7 +60,7 @@ import { AngularYandexMapsModule } from 'angular8-yandex-maps';
export class AppModule {}
```

##### Own map config options
###### Own map config options

```typescript
import { AngularYandexMapsModule, YaConfig } from 'angular8-yandex-maps';
Expand All @@ -74,7 +76,61 @@ const mapConfig: YaConfig = {
export class AppModule {}
```

### component.html
#### component.html

```html
<div class="container">
<ya-map [center]="[55.751952, 37.600739]" [zoom]="12">
<ya-placemark [geometry]="[55.751952, 37.600739]"></ya-placemark>
</ya-map>
</div>
```

#### component.css

```css
.container {
width: 1000px;
height: 500px;
}
```

### Standalone

#### component.ts

###### Default map config options

```typescript
import { AngularYandexMapsModule } from 'angular8-yandex-maps';

@Component({
selector: 'app-component',
standalone: true,
imports: [AngularYandexMapsModule],
})
export class Component {}
```

###### Own map config options

#### app.config.ts

```typescript
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
import { YaConfig, AngularYandexMapsModule } from 'angular8-yandex-maps';

const mapConfig: YaConfig = {
apikey: 'API_KEY',
lang: 'en_US',
};

export const appConfig: ApplicationConfig = {
providers: [importProvidersFrom(AngularYandexMapsModule.forRoot(mapConfig))],
};
```

#### component.html

```html
<div class="container">
Expand All @@ -84,7 +140,7 @@ export class AppModule {}
</div>
```

### component.css
#### component.css

```css
.container {
Expand Down
15 changes: 4 additions & 11 deletions apps/angular8-yandex-maps-demo/project.json
Expand Up @@ -59,18 +59,18 @@
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "angular8-yandex-maps-demo:build:production"
"buildTarget": "angular8-yandex-maps-demo:build:production"
},
"development": {
"browserTarget": "angular8-yandex-maps-demo:build:development"
"buildTarget": "angular8-yandex-maps-demo:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "angular8-yandex-maps-demo:build"
"buildTarget": "angular8-yandex-maps-demo:build"
}
},
"lint": {
Expand All @@ -87,14 +87,7 @@
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/angular8-yandex-maps-demo/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
"jestConfig": "apps/angular8-yandex-maps-demo/jest.config.ts"
}
},
"serve-static": {
Expand Down
68 changes: 62 additions & 6 deletions libs/angular8-yandex-maps/README.md
Expand Up @@ -31,7 +31,7 @@ npm install angular8-yandex-maps

| Angular version | Library version |
| ---------------------- | --------------- |
| v16 | v16.x |
| v16, v17 | v17.x |
| v15 | v15.x |
| v14 | v14.x |
| v9, v10, v11, v12, v13 | v13.x |
Expand All @@ -45,9 +45,11 @@ npm install angular8-yandex-maps@^8.0.0

## Usage

### app.module.ts
### SCAM

##### Default map config options
#### app.module.ts

###### Default map config options

```typescript
import { AngularYandexMapsModule } from 'angular8-yandex-maps';
Expand All @@ -58,7 +60,7 @@ import { AngularYandexMapsModule } from 'angular8-yandex-maps';
export class AppModule {}
```

##### Own map config options
###### Own map config options

```typescript
import { AngularYandexMapsModule, YaConfig } from 'angular8-yandex-maps';
Expand All @@ -74,7 +76,61 @@ const mapConfig: YaConfig = {
export class AppModule {}
```

### component.html
#### component.html

```html
<div class="container">
<ya-map [center]="[55.751952, 37.600739]" [zoom]="12">
<ya-placemark [geometry]="[55.751952, 37.600739]"></ya-placemark>
</ya-map>
</div>
```

#### component.css

```css
.container {
width: 1000px;
height: 500px;
}
```

### Standalone

#### component.ts

###### Default map config options

```typescript
import { AngularYandexMapsModule } from 'angular8-yandex-maps';

@Component({
selector: 'app-component',
standalone: true,
imports: [AngularYandexMapsModule],
})
export class Component {}
```

###### Own map config options

#### app.config.ts

```typescript
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
import { YaConfig, AngularYandexMapsModule } from 'angular8-yandex-maps';

const mapConfig: YaConfig = {
apikey: 'API_KEY',
lang: 'en_US',
};

export const appConfig: ApplicationConfig = {
providers: [importProvidersFrom(AngularYandexMapsModule.forRoot(mapConfig))],
};
```

#### component.html

```html
<div class="container">
Expand All @@ -84,7 +140,7 @@ export class AppModule {}
</div>
```

### component.css
#### component.css

```css
.container {
Expand Down
4 changes: 2 additions & 2 deletions libs/angular8-yandex-maps/package.json
Expand Up @@ -21,8 +21,8 @@
},
"homepage": "https://github.com/ddubrava/angular8-yandex-maps#readme",
"peerDependencies": {
"@angular/common": "^16.0.0",
"@angular/core": "^16.0.0"
"@angular/common": "^16.0.0 || ^17.0.0",
"@angular/core": "^16.0.0 || ^17.0.0"
},
"dependencies": {
"tslib": "^2.3.0"
Expand Down
9 changes: 1 addition & 8 deletions libs/angular8-yandex-maps/project.json
Expand Up @@ -26,14 +26,7 @@
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/angular8-yandex-maps/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
"jestConfig": "libs/angular8-yandex-maps/jest.config.ts"
}
},
"lint": {
Expand Down
31 changes: 0 additions & 31 deletions libs/docsifier/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 13 additions & 8 deletions nx.json
Expand Up @@ -6,17 +6,22 @@
"inputs": ["production", "^production"],
"cache": true
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true
},
"e2e": {
"inputs": ["default", "^production"],
"cache": true
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json", "{workspaceRoot}/.eslintignore"],
"cache": true
},
"@nx/jest:jest": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true,
"options": {
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},
"namedInputs": {
Expand Down

0 comments on commit bebaf67

Please sign in to comment.