Skip to content

Commit

Permalink
chore: update 'calendar' demo for nativescript-ui-calendar v4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ns-bot committed Jun 6, 2019
1 parent 5b1b0ed commit 484b482
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class CalendarDayViewComponent implements OnInit {
private _style: CalendarDayViewStyle;
private _weekVisible: boolean;
private _titleVisible: boolean;
@ViewChild("myCalendar") _calendar: RadCalendarComponent;
@ViewChild("myCalendar", { static: true }) _calendar: RadCalendarComponent;

constructor(private _calendarService: CalendarDayEventsService) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Injectable, OnInit, ViewChild } from "@angular/core";
import { Component, Injectable, ViewChild } from "@angular/core";
import { Page } from "tns-core-modules/ui/page";
import { RadCalendar } from "nativescript-ui-calendar";
import { RadCalendarComponent } from "nativescript-ui-calendar/angular";
Expand All @@ -13,7 +13,7 @@ export class CalendarProgrammaticControlComponent {
constructor() {
}

@ViewChild("myCalendar") _calendar: RadCalendarComponent;
@ViewChild("myCalendar", { static: false }) _calendar: RadCalendarComponent;

onNavigateForwardTap() {
this._calendar.nativeElement.navigateForward();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class CalendarSelectionModesComponent extends OptionsExampleBase {
return this._selectionMode;
}

@ViewChild("myCalendar") _calendar: RadCalendarComponent;
@ViewChild("myCalendar", { static: false }) _calendar: RadCalendarComponent;

onNoneTap() {
this._selectionMode = CalendarSelectionMode.None;
Expand Down
7 changes: 6 additions & 1 deletion calendar/app/navigation/options/options.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class OptionsComponent implements OnInit, OnDestroy {
this._dataItems = new ObservableArray<string>();
}

@ViewChild("optionsListView") _listView: any;
@ViewChild("optionsListView", { static: true }) _listView: any;

ngOnInit() {
this._sub = this._route.queryParams.subscribe(
Expand All @@ -34,6 +34,11 @@ export class OptionsComponent implements OnInit, OnDestroy {
}
}
);
const listView = this._listView.nativeElement;
const index = this._selectedIndex;
setTimeout(function () {
listView.ios.selectRowAtIndexPathAnimatedScrollPosition(NSIndexPath.indexPathForItemInSection(index, 0), false, 0);
}, 0);
}

ngOnDestroy() {
Expand Down
27 changes: 15 additions & 12 deletions calendar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,27 @@
}
},
"dependencies": {
"@angular/animations": "~7.2.0",
"@angular/common": "~7.2.0",
"@angular/compiler": "~7.2.0",
"@angular/core": "~7.2.0",
"@angular/forms": "~7.2.0",
"@angular/http": "~7.2.0",
"@angular/platform-browser": "~7.2.0",
"@angular/platform-browser-dynamic": "~7.2.0",
"@angular/router": "~7.2.0",
"nativescript-angular": "~7.2.0",
"@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/http": "8.0.0-beta.10",
"@angular/platform-browser": "~8.0.0",
"@angular/platform-browser-dynamic": "~8.0.0",
"@angular/router": "~8.0.0",
"nativescript-angular": "~8.0.0",
"nativescript-theme-core": "~1.0.4",
"nativescript-ui-calendar": "*",
"reflect-metadata": "~0.1.10",
"rxjs": "^6.3.3",
"tns-core-modules": "^5.0.0",
"typescript": "~3.4.5",
"zone.js": "~0.8.18"
},
"devDependencies": {
"@angular/compiler-cli": "~8.0.0",
"@ngtools/webpack": "~8.0.0",
"@types/chai": "~4.1.3",
"@types/mocha": "~5.2.1",
"@types/node": "^7.0.5",
Expand All @@ -47,8 +50,8 @@
"mochawesome": "^3.1.1",
"nativescript-css-loader": "~0.26.0",
"nativescript-dev-appium": "5.2.0",
"nativescript-dev-typescript": "~0.9.0",
"nativescript-dev-webpack": "~0.22.0",
"nativescript-dev-typescript": "~0.10.0",
"nativescript-dev-webpack": "~0.24.0",
"tns-platform-declarations": "^5.4.1",
"tslib": "1.7.1",
"tslint": "~5.11.0"
Expand Down

0 comments on commit 484b482

Please sign in to comment.