Commit 34b11fee9aa048733c917f808cd392920bffd120

Authored by Victor Costa
1 parent c046c510

Fix warnings in typescript code

src/lib/ng-noosfero-api/interfaces/article.ts
1 1
2 namespace noosfero { 2 namespace noosfero {
3 - export interface Article extends RestModel { 3 + export interface Article extends RestModel {
4 path: string; 4 path: string;
5 profile: Profile; 5 profile: Profile;
6 type: string; 6 type: string;
7 - parent: Article; 7 + parent: Article;
8 body: string; 8 body: string;
9 title: string; 9 title: string;
10 name: string; 10 name: string;
11 published: boolean; 11 published: boolean;
12 setting: any; 12 setting: any;
  13 + start_date: string;
  14 + end_date: string;
13 } 15 }
14 -}  
15 \ No newline at end of file 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,22 +18,22 @@ export class DiscussionEditorComponent {
18 18
19 convertDate(attributeName: string) { 19 convertDate(attributeName: string) {
20 this.$scope.$watch(() => { 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 ngOnInit() { 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 } else { 32 } else {
33 this.start_date = moment().toDate(); 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 }