This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [core] | |
| autocrlf = input | |
| editor = code --wait | |
| [alias] | |
| a = add --all | |
| ap = add --patch | |
| ai = add -i | |
| b = branch | |
| bdd = branch -D | |
| co = checkout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const navigationExtras = { | |
| queryParams: { | |
| "geolocation": JSON.stringify(this.currentGeoLocation), | |
| }, | |
| transition: { | |
| name: "slide", | |
| duration: 250, | |
| curve: "easeInOut" | |
| } | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| onCurrentLocationTap() { | |
| const navigationExtras = { | |
| queryParams: { | |
| "geolocation": JSON.stringify(this.currentGeoLocation), | |
| } | |
| }; | |
| this._routerExtensions.navigate(['/categories'], navigationExtras); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Button *ngIf="currentGeoLocation" row="3" text="Current location" class="btn btn-primary h4" (tap)="onCurrentLocationTap()"></Button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class CategoriesComponent { | |
| currentGeoLocation: any; | |
| constructor(private _activatedRoute: ActivatedRoute) { | |
| try { | |
| this.currentGeoLocation = JSON.parse(this._activatedRoute.snapshot.queryParams['geolocation']); | |
| } catch (e) { | |
| console.error(e); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <StackLayout *ngIf="currentGeoLocation"> | |
| <Label text="Latitude: {{ currentGeoLocation.latitude }}"></Label> | |
| <Label text="Longitude: {{ currentGeoLocation.longitude }}"></Label> | |
| <Label text="Altitude: {{ currentGeoLocation.altitude }}"></Label> | |
| <Label text="Direction: {{ currentGeoLocation.direction }}"></Label> | |
| </StackLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const routes: Routes = [ | |
| { path: "", redirectTo: "/categories", pathMatch: "full" }, | |
| { path: "home", loadChildren: "./home/home.module#HomeModule" }, | |
| { path: "categories", loadChildren: "./categories/categories.module#CategoriesModule" } | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { NgModule } from "@angular/core"; | |
| import { Routes } from "@angular/router"; | |
| import { NativeScriptRouterModule } from "nativescript-angular/router"; | |
| import { CategoriesComponent } from "./categories.component"; | |
| const routes: Routes = [ | |
| { path: "", component: CategoriesComponent } | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .btn-primary { | |
| border-radius: 10; | |
| background-color: #FF4F3C; | |
| color: white; | |
| text-transform: none; | |
| height: 54; | |
| } | |
| .btn-primary:highlighted { | |
| color: white; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ngOnInit(): void { | |
| this.enableLocationServices(); | |
| } |
NewerOlder