Skip to content

Commit

Permalink
Merge pull request #84 from explooosion/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
explooosion authored Jan 5, 2020
2 parents ac91df4 + d7bb117 commit 7fc067c
Show file tree
Hide file tree
Showing 17 changed files with 2,274 additions and 1,156 deletions.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

- Angular
- Google Map API
- [Playground](https://stackblitz.com/edit/agm-direction-demo)

How to use?
👉 [Start Reading](https://robby570.tw/Agm-Direction-Docs/)
Expand Down Expand Up @@ -67,7 +66,10 @@ HTML

```html
<agm-map [latitude]="lat" [longitude]="lng">
<agm-direction [origin]="origin" [destination]="destination">
<agm-direction
[origin]="origin"
[destination]="destination"
>
</agm-direction>
</agm-map>
```
Expand Down Expand Up @@ -97,6 +99,7 @@ getDirection() {
this.origin = { lat: 24.799448, lng: 120.979021 };
this.destination = { lat: 24.799524, lng: 120.975017 };

// Location within a string
// this.origin = 'Taipei Main Station';
// this.destination = 'Taiwan Presidential Office';
}
Expand All @@ -108,18 +111,30 @@ getDirection() {

## Development

👉 [Playground](https://github.com/explooosion/Agm-Direction/tree/master/playground)
👉 [Playground Project](https://github.com/explooosion/Agm-Direction/tree/master/playground)

```bash
git clone https://github.com/explooosion/Agm-Direction.git
```

```bash
npm install
```

```bash
npm run pack:build
```

```bash
cd playground
```

```bash
yarn start
# Add gmap api key in environment.ts
```

```bash
npm start
```

## Generator
Expand Down
4 changes: 2 additions & 2 deletions playground/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
/node_modules

# profiling files
chrome-profiler-events.json
speed-measure-plugin.json
chrome-profiler-events*.json
speed-measure-plugin*.json

# IDEs and editors
/.idea
Expand Down
2 changes: 1 addition & 1 deletion playground/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Playground

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.0.0.
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.21.

## Development server

Expand Down
6 changes: 6 additions & 0 deletions playground/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": [
"src/favicon.ico",
"src/assets"
Expand Down Expand Up @@ -49,6 +50,11 @@
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion playground/e2e/protractor.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports.config = {
'./src/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
browserName: 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
Expand Down
2 changes: 1 addition & 1 deletion playground/e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('workspace-project App', () => {

it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('Welcome to playground!');
expect(page.getTitleText()).toEqual('playground app is running!');
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion playground/e2e/src/app.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export class AppPage {
}

getTitleText() {
return element(by.css('app-root h1')).getText() as Promise<string>;
return element(by.css('app-root .content span')).getText() as Promise<string>;
}
}
31 changes: 15 additions & 16 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,26 @@
},
"private": true,
"dependencies": {
"@agm/core": "^1.0.0-beta.5",
"@angular/animations": "~8.0.0",
"@angular/common": "~8.0.0",
"@angular/compiler": "~8.0.0",
"@angular/core": "~8.0.0",
"@angular/forms": "~8.0.0",
"@angular/platform-browser": "~8.0.0",
"@angular/platform-browser-dynamic": "~8.0.0",
"@angular/router": "~8.0.0",
"@angular/animations": "~8.2.14",
"@angular/common": "~8.2.14",
"@angular/compiler": "~8.2.14",
"@angular/core": "~8.2.14",
"@angular/forms": "~8.2.14",
"@angular/platform-browser": "~8.2.14",
"@angular/platform-browser-dynamic": "~8.2.14",
"@angular/router": "~8.2.14",
"rxjs": "~6.4.0",
"tslib": "^1.9.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.800.0",
"@angular/cli": "~8.0.0",
"@angular/compiler-cli": "~8.0.0",
"@angular/language-service": "~8.0.0",
"@angular-devkit/build-angular": "~0.803.21",
"@angular/cli": "~8.3.21",
"@angular/compiler-cli": "~8.2.14",
"@angular/language-service": "~8.2.14",
"@types/node": "~8.9.4",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
Expand All @@ -43,6 +42,6 @@
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.4.3"
"typescript": "~3.5.3"
}
}
4 changes: 2 additions & 2 deletions playground/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ describe('AppComponent', () => {
expect(app.title).toEqual('playground');
});

it('should render title in a h1 tag', () => {
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to playground!');
expect(compiled.querySelector('.content span').textContent).toContain('playground app is running!');
});
});
2 changes: 1 addition & 1 deletion playground/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

export const environment = {
production: false,
googleAPIKey: 'AIzaSyD5g_QO7b1pBfgl9OtX6vchzZwX1Vmxo2Y',
googleAPIKey: '',
};

/*
Expand Down
Binary file modified playground/src/favicon.ico
Binary file not shown.
1 change: 0 additions & 1 deletion playground/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Playground</title>
<base href="/">

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
Expand Down
4 changes: 4 additions & 0 deletions playground/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.ts"
],
Expand Down
8 changes: 6 additions & 2 deletions playground/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2015",
"typeRoots": [
Expand All @@ -22,5 +22,9 @@
"@angular/*": ["node_modules/@angular/*"],
"@agm/*": ["node_modules/@agm/*"]
}
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
}
}
3 changes: 1 addition & 2 deletions playground/tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"array-type": false,
"arrow-parens": false,
"deprecation": {
"severity": "warn"
"severity": "warning"
},
"component-class-suffix": true,
"contextual-lifecycle": true,
Expand Down Expand Up @@ -60,7 +60,6 @@
"no-non-null-assertion": true,
"no-redundant-jsdoc": true,
"no-switch-case-fall-through": true,
"no-use-before-declare": true,
"no-var-requires": false,
"object-literal-key-quotes": [
true,
Expand Down
Loading

0 comments on commit 7fc067c

Please sign in to comment.