From f1657a477e7d1decfcba1315cc47cdff78875ac2 Mon Sep 17 00:00:00 2001 From: Tyler Berry Date: Tue, 13 Sep 2016 15:17:01 -0600 Subject: [PATCH] bug with ng2-bootstrap - ignoring for now Subscribed to this thread to follow the issue: https://github.com/valor-software/ng2-bootstrap/issues/854 --- src/app/problems/problem/problem.module.ts | 2 ++ src/app/shared/services/index.ts | 1 - src/app/shared/services/submission.service.ts | 20 ------------------- src/app/submission-modal/index.ts | 2 +- .../submission-modal.component.html | 5 ++++- .../submission-modal.component.ts | 15 +++++++------- ...n-modal.module.ts => submission.module.ts} | 17 +++++++++------- .../submission-modal/submission.service.ts | 20 +++++++++++++++++++ 8 files changed, 45 insertions(+), 37 deletions(-) delete mode 100644 src/app/shared/services/submission.service.ts rename src/app/submission-modal/{submission-modal.module.ts => submission.module.ts} (55%) create mode 100644 src/app/submission-modal/submission.service.ts diff --git a/src/app/problems/problem/problem.module.ts b/src/app/problems/problem/problem.module.ts index 2125ba9..4a9c064 100644 --- a/src/app/problems/problem/problem.module.ts +++ b/src/app/problems/problem/problem.module.ts @@ -14,6 +14,7 @@ import { RankingComponent } from './leaderboard/ranking'; import { SharingService } from './shared'; import { FormattingModule } from '../../shared'; import { CodeEditorModule } from '../../code-editor'; +import { SubmissionModule } from '../../submission-modal'; @NgModule({ imports: [ @@ -24,6 +25,7 @@ import { CodeEditorModule } from '../../code-editor'; FormattingModule, CodeEditorModule, + SubmissionModule, problemRouting ], declarations: [ diff --git a/src/app/shared/services/index.ts b/src/app/shared/services/index.ts index 8afdb05..41421ff 100644 --- a/src/app/shared/services/index.ts +++ b/src/app/shared/services/index.ts @@ -1,2 +1 @@ export * from './login-modal.service'; -export * from './submission.service'; diff --git a/src/app/shared/services/submission.service.ts b/src/app/shared/services/submission.service.ts deleted file mode 100644 index e28be5b..0000000 --- a/src/app/shared/services/submission.service.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Http, Headers } from '@angular/http'; -import { Observable } from 'rxjs'; -import { Result, Submission } from '../'; - -const Url = 'http://code.neumont.edu/submit'; -const RequestHeaders = new Headers({ - 'Content-Type': 'application/json' -}); - -@Injectable() -export class SubmissionService { - constructor(private http: Http) {} - - submit(submission: Submission): Observable { - return this.http - .post(Url, submission, {headers: RequestHeaders}) - .map(res => res.json() as Result); - } -} diff --git a/src/app/submission-modal/index.ts b/src/app/submission-modal/index.ts index e8748c7..e698a40 100644 --- a/src/app/submission-modal/index.ts +++ b/src/app/submission-modal/index.ts @@ -1,2 +1,2 @@ export * from './submission-modal.component'; -export * from './submission-modal.module'; +export * from './submission.module'; diff --git a/src/app/submission-modal/submission-modal.component.html b/src/app/submission-modal/submission-modal.component.html index 7c3c523..1ae9e97 100644 --- a/src/app/submission-modal/submission-modal.component.html +++ b/src/app/submission-modal/submission-modal.component.html @@ -1,5 +1,8 @@ + + +