From 34b11fee9aa048733c917f808cd392920bffd120 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Tue, 10 May 2016 16:59:44 -0300 Subject: [PATCH] Fix warnings in typescript code --- src/lib/ng-noosfero-api/interfaces/article.ts | 8 +++++--- src/plugins/comment_paragraph/article/cms/discussion-editor/discussion-editor.component.ts | 14 +++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/lib/ng-noosfero-api/interfaces/article.ts b/src/lib/ng-noosfero-api/interfaces/article.ts index 4ca2e4c..6d48bc2 100644 --- a/src/lib/ng-noosfero-api/interfaces/article.ts +++ b/src/lib/ng-noosfero-api/interfaces/article.ts @@ -1,14 +1,16 @@ namespace noosfero { - export interface Article extends RestModel { + export interface Article extends RestModel { path: string; profile: Profile; type: string; - parent: Article; + parent: Article; body: string; title: string; name: string; published: boolean; setting: any; + start_date: string; + end_date: string; } -} \ No newline at end of file +} diff --git a/src/plugins/comment_paragraph/article/cms/discussion-editor/discussion-editor.component.ts b/src/plugins/comment_paragraph/article/cms/discussion-editor/discussion-editor.component.ts index ed7d9b5..8266bb2 100644 --- a/src/plugins/comment_paragraph/article/cms/discussion-editor/discussion-editor.component.ts +++ b/src/plugins/comment_paragraph/article/cms/discussion-editor/discussion-editor.component.ts @@ -18,22 +18,22 @@ export class DiscussionEditorComponent { convertDate(attributeName: string) { this.$scope.$watch(() => { - return this[attributeName]; + return (this)[attributeName]; }, () => { - if (this[attributeName]) { - this.article[attributeName] = this[attributeName].toISOString(); + if ((this)[attributeName]) { + (this.article)[attributeName] = (this)[attributeName].toISOString(); } }); } ngOnInit() { - if (this.article['start_date']) { - this.start_date = new Date(this.article['start_date']); + if (this.article.start_date) { + this.start_date = new Date(this.article.start_date); } else { this.start_date = moment().toDate(); } - if (this.article['end_date']) { - this.end_date = new Date(this.article['end_date']); + if (this.article.end_date) { + this.end_date = new Date(this.article.end_date); } } } -- libgit2 0.21.2