Commit 34b11fee9aa048733c917f808cd392920bffd120
1 parent
c046c510
Exists in
master
and in
26 other branches
Fix warnings in typescript code
Showing
2 changed files
with
12 additions
and
10 deletions
Show diff stats
src/lib/ng-noosfero-api/interfaces/article.ts
1 | 1 | |
2 | 2 | namespace noosfero { |
3 | - export interface Article extends RestModel { | |
3 | + export interface Article extends RestModel { | |
4 | 4 | path: string; |
5 | 5 | profile: Profile; |
6 | 6 | type: string; |
7 | - parent: Article; | |
7 | + parent: Article; | |
8 | 8 | body: string; |
9 | 9 | title: string; |
10 | 10 | name: string; |
11 | 11 | published: boolean; |
12 | 12 | setting: any; |
13 | + start_date: string; | |
14 | + end_date: string; | |
13 | 15 | } |
14 | -} | |
15 | 16 | \ No newline at end of file |
17 | +} | ... | ... |
src/plugins/comment_paragraph/article/cms/discussion-editor/discussion-editor.component.ts
... | ... | @@ -18,22 +18,22 @@ export class DiscussionEditorComponent { |
18 | 18 | |
19 | 19 | convertDate(attributeName: string) { |
20 | 20 | this.$scope.$watch(() => { |
21 | - return this[attributeName]; | |
21 | + return (<any>this)[attributeName]; | |
22 | 22 | }, () => { |
23 | - if (this[attributeName]) { | |
24 | - this.article[attributeName] = this[attributeName].toISOString(); | |
23 | + if ((<any>this)[attributeName]) { | |
24 | + (<any>this.article)[attributeName] = (<any>this)[attributeName].toISOString(); | |
25 | 25 | } |
26 | 26 | }); |
27 | 27 | } |
28 | 28 | |
29 | 29 | ngOnInit() { |
30 | - if (this.article['start_date']) { | |
31 | - this.start_date = new Date(this.article['start_date']); | |
30 | + if (this.article.start_date) { | |
31 | + this.start_date = new Date(this.article.start_date); | |
32 | 32 | } else { |
33 | 33 | this.start_date = moment().toDate(); |
34 | 34 | } |
35 | - if (this.article['end_date']) { | |
36 | - this.end_date = new Date(this.article['end_date']); | |
35 | + if (this.article.end_date) { | |
36 | + this.end_date = new Date(this.article.end_date); | |
37 | 37 | } |
38 | 38 | } |
39 | 39 | } | ... | ... |