Преглед на файлове

Process of making channel work

jpsp91 преди 6 години
родител
ревизия
74a4e5ca9f

BIN
.DS_Store Целия файл


+ 1
- 0
.sourcemaps/0.js.map Целия файл

@@ -0,0 +1 @@
1
+{"version":3,"sources":["../../src/pages/channel/channel.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAyC;AACO;AACR;AAUxC;IAAA;IAAgC,CAAC;IAApB,iBAAiB;QAR7B,uEAAQ,CAAC;YACR,YAAY,EAAE;gBACZ,6DAAW;aACZ;YACD,OAAO,EAAE;gBACP,sEAAe,CAAC,QAAQ,CAAC,6DAAW,CAAC;aACtC;SACF,CAAC;OACW,iBAAiB,CAAG;IAAD,wBAAC;CAAA;AAAH","file":"0.js","sourcesContent":["import { NgModule } from '@angular/core';\nimport { IonicPageModule } from 'ionic-angular';\nimport { ChannelPage } from './channel';\n\n@NgModule({\n  declarations: [\n    ChannelPage,\n  ],\n  imports: [\n    IonicPageModule.forChild(ChannelPage),\n  ],\n})\nexport class ChannelPageModule {}\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/channel/channel.module.ts"],"sourceRoot":""}

+ 1
- 0
.sourcemaps/main.js.map
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 15
- 2
src/app/app.html Целия файл

@@ -1,7 +1,13 @@
1
+
2
+
3
+
4
+
5
+
6
+
1 7
 <ion-menu [content]="content">
2 8
   <ion-header>
3 9
     <ion-toolbar>
4
-      <ion-title>Menu</ion-title>
10
+      <ion-title>Zip-Slack</ion-title>
5 11
     </ion-toolbar>
6 12
   </ion-header>
7 13
 
@@ -11,9 +17,16 @@
11 17
         {{p.title}}
12 18
       </button>
13 19
     </ion-list>
20
+
21
+
22
+
23
+
14 24
   </ion-content>
15 25
 
16 26
 </ion-menu>
17 27
 
18 28
 <!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
19
-<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
29
+<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
30
+
31
+
32
+

+ 11
- 1
src/app/app.module.ts Целия файл

@@ -9,6 +9,11 @@ import { ChannelPage } from '../pages/channel/channel';
9 9
 
10 10
 import { StatusBar } from '@ionic-native/status-bar';
11 11
 import { SplashScreen } from '@ionic-native/splash-screen';
12
+import { UserProvider } from '../providers/user/user';
13
+import { HttpClientModule } from '@angular/common/http';
14
+import { HttpModule } from '@angular/http';
15
+import { MessageProvider } from '../providers/message/message';
16
+
12 17
 
13 18
 @NgModule({
14 19
   declarations: [
@@ -20,6 +25,9 @@ import { SplashScreen } from '@ionic-native/splash-screen';
20 25
   imports: [
21 26
     BrowserModule,
22 27
     IonicModule.forRoot(MyApp),
28
+    HttpClientModule,
29
+    HttpModule
30
+  
23 31
   ],
24 32
   bootstrap: [IonicApp],
25 33
   entryComponents: [
@@ -31,7 +39,9 @@ import { SplashScreen } from '@ionic-native/splash-screen';
31 39
   providers: [
32 40
     StatusBar,
33 41
     SplashScreen,
34
-    {provide: ErrorHandler, useClass: IonicErrorHandler}
42
+    {provide: ErrorHandler, useClass: IonicErrorHandler},
43
+    UserProvider,
44
+    MessageProvider
35 45
   ]
36 46
 })
37 47
 export class AppModule {}

+ 49
- 7
src/pages/channel/channel.html Целия файл

@@ -1,18 +1,60 @@
1
-<!--
2
-  Generated template for the ChannelPage page.
3 1
 
4
-  See http://ionicframework.com/docs/components/#navigation for more info on
5
-  Ionic pages and navigation.
6
--->
2
+
3
+
4
+<!-- <ion-buttons start>
5
+
6
+  <button ion-button icon-only menuToggle>
7
+
8
+    <ion-icon name="menu"></ion-icon>
9
+
10
+  </button>
11
+
12
+</ion-buttons> -->
13
+
14
+
15
+
7 16
 <ion-header>
8 17
 
9 18
   <ion-navbar>
10
-    <ion-title>channel</ion-title>
19
+    <ion-title>Channel</ion-title>
20
+
21
+    <ion-buttons start>
22
+
23
+        <button ion-button icon-only menuToggle>
24
+      
25
+          <ion-icon name="menu"></ion-icon>
26
+      
27
+        </button>
28
+      
29
+      </ion-buttons>
11 30
   </ion-navbar>
12 31
 
13 32
 </ion-header>
14 33
 
15 34
 
35
+
16 36
 <ion-content padding>
17 37
 
18
-</ion-content>
38
+    <ion-list padding>
39
+      <ion-item-sliding *ngFor="let message of messages">
40
+        <ion-item>{{message.message}}</ion-item>
41
+    
42
+        <ion-item-options side="right">
43
+   
44
+            <button ion-button>
45
+                <ion-icon name="settings"></ion-icon>
46
+              </button>
47
+   
48
+            <!-- <button color="danger" ion-button (click)="deleteMessage(todo.id)">
49
+              <ion-icon name="trash"></ion-icon>
50
+            </button> -->
51
+   
52
+        </ion-item-options>
53
+      </ion-item-sliding>
54
+      
55
+      <!-- <ion-item>Todo 2</ion-item>
56
+      <ion-item>Todo 3</ion-item> -->
57
+    </ion-list>
58
+   
59
+   </ion-content>
60
+

+ 46
- 1
src/pages/channel/channel.ts Целия файл

@@ -1,5 +1,6 @@
1 1
 import { Component } from '@angular/core';
2 2
 import { IonicPage, NavController, NavParams } from 'ionic-angular';
3
+import { MessageProvider } from '../../providers/message/message';
3 4
 
4 5
 /**
5 6
  * Generated class for the ChannelPage page.
@@ -15,11 +16,55 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
15 16
 })
16 17
 export class ChannelPage {
17 18
 
18
-  constructor(public navCtrl: NavController, public navParams: NavParams) {
19
+
20
+  public messages=[
21
+    {
22
+      message: "Hello"
23
+    },
24
+    {
25
+      message: "sup"
26
+    }
27
+  ]
28
+
29
+  constructor(public navCtrl: NavController, public navParams: NavParams, 
30
+    private messageProvider: MessageProvider) {
31
+
32
+      this.getMessages();
33
+      
34
+
19 35
   }
20 36
 
21 37
   ionViewDidLoad() {
22 38
     console.log('ionViewDidLoad ChannelPage');
23 39
   }
24 40
 
41
+
42
+
43
+
44
+  getMessages(){
45
+    this.messageProvider.get(1, after => {
46
+      this.messages = after;
47
+    });
48
+  }
49
+ 
50
+  deleteMessage(messageId: number){
51
+    this.messageProvider.delete(messageId, after =>{
52
+      this.getMessages();
53
+    });
54
+  }
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
25 66
 }
67
+
68
+
69
+
70
+

+ 38
- 6
src/pages/home/home.html Целия файл

@@ -1,7 +1,8 @@
1 1
 <ion-header>
2
-
3 2
 </ion-header>
4 3
 
4
+
5
+
5 6
 <ion-content text-center class = "login">
6 7
 
7 8
   <br><br><br><br><br>
@@ -9,24 +10,39 @@
9 10
 
10 11
   <br><br><br><br>
11 12
   
13
+
14
+
15
+  <form [formGroup]="formgroup" (ngSubmit)="sendLogin(formgroup.value)">
16
+
12 17
 <ion-list>
13 18
 
14 19
   <ion-item text-center>
15 20
 
21
+
16 22
     <ion-label fixed>Username</ion-label>
17
-    <ion-input type="text" value=""></ion-input>
23
+    <ion-input type="text" formControlName="username"></ion-input>
24
+  </ion-item>
25
+
26
+  <ion-item text-center *ngIf="username.hasError('required') && username.touched">
27
+    <p> *Please enter your username</p>
18 28
   </ion-item>
19 29
 
20 30
   <ion-item text-center>
21 31
     <ion-label fixed>Password</ion-label>
22
-    <ion-input type="password"></ion-input>
32
+    <ion-input type="password" formControlName="password"></ion-input>
23 33
   </ion-item>
24 34
 
35
+  <ion-item text-center *ngIf="password.hasError('required') && password.touched">
36
+      <p> *Please enter your password</p>
37
+    </ion-item>
38
+
39
+
25 40
 </ion-list>
26 41
 
27 42
 
28 43
 
29
-<button ion-button color="danger" round (click)="login()">Login</button>
44
+
45
+<button ion-button color="danger" round type="submit">Login</button>
30 46
 
31 47
 <!-- line break -->
32 48
 <br>
@@ -34,10 +50,26 @@
34 50
 <button ion-button color="danger" round>Sign Up</button>
35 51
 
36 52
 
53
+</form>
54
+
55
+
56
+  <!-- <form [formGroup]="loginform" (ngSubmit)="sendLogin(loginForm.value)" *ngIf="loginForm">
57
+
58
+    <ion-label fixed>Username</ion-label>
59
+    <input type="text" name="name" formControlName="username">
60
+
61
+    <ion-label fixed>Password</ion-label>
62
+    <input type="text" name="name" formControlName="password">
63
+
64
+    <input type="submit" class="cta-btn filled" value="Submit" [disabled]="!loginForm.valid">
65
+   </form> -->
66
+
67
+
37 68
 
38 69
 
39 70
 
40 71
   <!-- Toggle menu button -->
41
-  <!-- <br>
42
-  <button ion-button secondary menuToggle>Toggle Menu</button>  -->
72
+  <!-- <br> -->
73
+  <button ion-button secondary menuToggle>Toggle Menu</button> 
74
+  
43 75
 </ion-content>

+ 36
- 2
src/pages/home/home.ts Целия файл

@@ -1,6 +1,9 @@
1 1
 import { Component } from '@angular/core';
2 2
 import { NavController } from 'ionic-angular';
3 3
 import { ChannelPage } from '../channel/channel';
4
+import { FormGroup, FormBuilder, Validators, AbstractControl } from '@angular/forms';
5
+import { UserProvider } from '../../providers/user/user';
6
+import { MessageProvider } from '../../providers/message/message';
4 7
 
5 8
 
6 9
 
@@ -11,18 +14,49 @@ import { ChannelPage } from '../channel/channel';
11 14
 
12 15
 export class HomePage {
13 16
 
14
-  constructor(public navCtrl: NavController) {
17
+
18
+  formgroup: FormGroup;
19
+
20
+  username: AbstractControl;
21
+  password: AbstractControl;
22
+
23
+  constructor(public navCtrl: NavController, private formbuilder: FormBuilder, private userprovider: UserProvider) {
24
+
25
+    this.formgroup=this.formbuilder.group(
26
+      
27
+      {username : ['',Validators.required],
28
+      password : ['', Validators.required]
29
+    });
30
+
31
+    this.username=this.formgroup.controls['username'];
32
+    this.password=this.formgroup.controls['password'];
15 33
 
16 34
   }
17 35
 
18 36
   login() {
19
-    this.navCtrl.push(ChannelPage);
37
+    this.navCtrl.setRoot(ChannelPage);
20 38
     
21 39
   }
22 40
 
41
+  sendLogin(loginForm) {
42
+    this.userprovider.login(loginForm.username, loginForm.password, result =>{
43
+      if(result.status == 200){
44
+        console.log("Success!");
45
+        this.userprovider.setToken(result.headers.get("authorization"));
46
+        console.log(this.userprovider.getToken());
47
+        this.navCtrl.setRoot(ChannelPage);
23 48
 
24 49
 
50
+      } else {
51
+        console.log("invalid login attempt");
52
+      }
53
+    });
54
+  }
55
+
25 56
 
57
+  setLoginForm() {
58
+
59
+  }
26 60
 
27 61
 
28 62
 

+ 91
- 0
src/providers/message/message.ts Целия файл

@@ -0,0 +1,91 @@
1
+import { HttpClient } from '@angular/common/http';
2
+import { Injectable } from '@angular/core';
3
+import { Http, RequestOptions, Headers, Response } from '@angular/http';
4
+import { UserProvider } from '../user/user';
5
+
6
+/*
7
+  Generated class for the MessageProvider provider.
8
+
9
+  See https://angular.io/guide/dependency-injection for more info on providers
10
+  and Angular DI.
11
+*/
12
+@Injectable()
13
+export class MessageProvider {
14
+
15
+  constructor(public http: Http, public userProvider: UserProvider) {
16
+    console.log('Hello MessageProvider Provider');
17
+  }
18
+
19
+
20
+
21
+
22
+
23
+  getAll(){
24
+    var url: string = "http://localhost:8080/get_messages";
25
+    var header = new Headers({
26
+      'Authorization': this.userProvider.getToken()
27
+    })
28
+    let options = new RequestOptions({headers: header})
29
+    this.http.get(url, options).subscribe( (result : Response) => {
30
+      console.log(result);
31
+    })
32
+  }
33
+ 
34
+  post(channelId: number, message: string, callback){
35
+    var url: string = "http://localhost:8080/post";
36
+    var header = new Headers({
37
+      'Authorization': this.userProvider.getToken(),
38
+      'Content-Type': 'application/json'
39
+      
40
+    });
41
+    let options = new RequestOptions({headers: header});
42
+ 
43
+    var body = {
44
+      "channelId": channelId,
45
+      "message": message
46
+    };
47
+ 
48
+    this.http.post(url, body,options).subscribe( (result : Response) => {
49
+      console.log(result);
50
+      this.get(channelId, after => {
51
+        callback();
52
+      })
53
+    })
54
+  }
55
+ 
56
+  get(channelId: number, callback){
57
+    var url: string = "http://localhost:8080/messages?channelid=" + channelId ;
58
+    var header = new Headers({
59
+      'Authorization': this.userProvider.getToken(),
60
+      'Content-Type': 'application/json'
61
+      
62
+    });
63
+    let options = new RequestOptions({headers: header});
64
+ 
65
+    this.http.get(url,options).subscribe(result =>{
66
+      console.log(result);
67
+      callback(result);
68
+    })
69
+  }
70
+ 
71
+  delete(messageId: number, callback){
72
+    var url: string = "http://localhost:8080/delete?messageId=" +messageId;
73
+    
74
+    var header = new Headers({
75
+      'Authorization': this.userProvider.getToken(),
76
+      'Content-Type': 'application/json'
77
+      
78
+    });
79
+ 
80
+    let options = new RequestOptions({headers: header});
81
+ 
82
+    this.http.delete(url,options).subscribe(result => {
83
+      console.log(result);
84
+      callback();
85
+    })
86
+  }
87
+
88
+
89
+
90
+
91
+}

+ 49
- 0
src/providers/user/user.ts Целия файл

@@ -0,0 +1,49 @@
1
+import { HttpClient } from '@angular/common/http';
2
+import { Injectable } from '@angular/core';
3
+import { Http, Headers, RequestOptions } from '@angular/http';
4
+
5
+/*
6
+  Generated class for the UserProvider provider.
7
+
8
+  See https://angular.io/guide/dependency-injection for more info on providers
9
+  and Angular DI.
10
+*/
11
+@Injectable()
12
+export class UserProvider {
13
+
14
+  constructor(public http: Http) {
15
+    console.log('Hello UserProvider Provider');
16
+  }
17
+
18
+
19
+
20
+  private token: string;
21
+
22
+  getToken(){return this.token}
23
+
24
+  setToken(token: string){this.token = token}
25
+
26
+  
27
+
28
+  login(username, password, callback){
29
+   
30
+    var url: string = "http://localhost:8080/login";
31
+ 
32
+    var header = new Headers({
33
+      'content-type': 'application/json',
34
+    })
35
+ 
36
+    let options = new RequestOptions({headers: header})
37
+ 
38
+    var body = {
39
+      "username": username,
40
+      "password": password
41
+    };
42
+ 
43
+    this.http.post(url,body, options).subscribe( result => {
44
+      callback(result);
45
+      //console.log(result.headers.get("authorization"));
46
+    })
47
+  }
48
+
49
+}

BIN
www/.DS_Store Целия файл


BIN
www/assets/.DS_Store Целия файл


BIN
www/assets/imgs/.DS_Store Целия файл


BIN
www/assets/imgs/icon.png Целия файл


+ 2
- 2
www/build/0.js Целия файл

@@ -1,6 +1,6 @@
1 1
 webpackJsonp([0],{
2 2
 
3
-/***/ 270:
3
+/***/ 279:
4 4
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
5 5
 
6 6
 "use strict";
@@ -8,7 +8,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
8 8
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChannelPageModule", function() { return ChannelPageModule; });
9 9
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
10 10
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(32);
11
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__channel__ = __webpack_require__(99);
11
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__channel__ = __webpack_require__(50);
12 12
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
13 13
     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14 14
     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);

+ 254
- 38
www/build/main.js Целия файл

@@ -1,6 +1,6 @@
1 1
 webpackJsonp([1],{
2 2
 
3
-/***/ 109:
3
+/***/ 113:
4 4
 /***/ (function(module, exports) {
5 5
 
6 6
 function webpackEmptyAsyncContext(req) {
@@ -13,16 +13,16 @@ function webpackEmptyAsyncContext(req) {
13 13
 webpackEmptyAsyncContext.keys = function() { return []; };
14 14
 webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
15 15
 module.exports = webpackEmptyAsyncContext;
16
-webpackEmptyAsyncContext.id = 109;
16
+webpackEmptyAsyncContext.id = 113;
17 17
 
18 18
 /***/ }),
19 19
 
20
-/***/ 150:
20
+/***/ 155:
21 21
 /***/ (function(module, exports, __webpack_require__) {
22 22
 
23 23
 var map = {
24 24
 	"../pages/channel/channel.module": [
25
-		270,
25
+		279,
26 26
 		0
27 27
 	]
28 28
 };
@@ -37,19 +37,117 @@ function webpackAsyncContext(req) {
37 37
 webpackAsyncContext.keys = function webpackAsyncContextKeys() {
38 38
 	return Object.keys(map);
39 39
 };
40
-webpackAsyncContext.id = 150;
40
+webpackAsyncContext.id = 155;
41 41
 module.exports = webpackAsyncContext;
42 42
 
43 43
 /***/ }),
44 44
 
45
-/***/ 194:
45
+/***/ 156:
46
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
47
+
48
+"use strict";
49
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MessageProvider; });
50
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
51
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_http__ = __webpack_require__(78);
52
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__user_user__ = __webpack_require__(79);
53
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
54
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
55
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
56
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
57
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
58
+};
59
+var __metadata = (this && this.__metadata) || function (k, v) {
60
+    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
61
+};
62
+
63
+
64
+
65
+/*
66
+  Generated class for the MessageProvider provider.
67
+
68
+  See https://angular.io/guide/dependency-injection for more info on providers
69
+  and Angular DI.
70
+*/
71
+var MessageProvider = /** @class */ (function () {
72
+    function MessageProvider(http, userProvider) {
73
+        this.http = http;
74
+        this.userProvider = userProvider;
75
+        console.log('Hello MessageProvider Provider');
76
+    }
77
+    MessageProvider.prototype.getAll = function () {
78
+        var url = "http://localhost:8080/get_messages";
79
+        var header = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["a" /* Headers */]({
80
+            'Authorization': this.userProvider.getToken()
81
+        });
82
+        var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* RequestOptions */]({ headers: header });
83
+        this.http.get(url, options).subscribe(function (result) {
84
+            console.log(result);
85
+        });
86
+    };
87
+    MessageProvider.prototype.post = function (channelId, message, callback) {
88
+        var _this = this;
89
+        var url = "http://localhost:8080/post";
90
+        var header = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["a" /* Headers */]({
91
+            'Authorization': this.userProvider.getToken(),
92
+            'Content-Type': 'application/json'
93
+        });
94
+        var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* RequestOptions */]({ headers: header });
95
+        var body = {
96
+            "channelId": channelId,
97
+            "message": message
98
+        };
99
+        this.http.post(url, body, options).subscribe(function (result) {
100
+            console.log(result);
101
+            _this.get(channelId, function (after) {
102
+                callback();
103
+            });
104
+        });
105
+    };
106
+    MessageProvider.prototype.get = function (channelId, callback) {
107
+        var url = "http://localhost:8080/messages?channelid=" + channelId;
108
+        var header = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["a" /* Headers */]({
109
+            'Authorization': this.userProvider.getToken(),
110
+            'Content-Type': 'application/json'
111
+        });
112
+        var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* RequestOptions */]({ headers: header });
113
+        this.http.get(url, options).subscribe(function (result) {
114
+            console.log(result);
115
+            callback(result);
116
+        });
117
+    };
118
+    MessageProvider.prototype.delete = function (messageId, callback) {
119
+        var url = "http://localhost:8080/delete?messageId=" + messageId;
120
+        var header = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["a" /* Headers */]({
121
+            'Authorization': this.userProvider.getToken(),
122
+            'Content-Type': 'application/json'
123
+        });
124
+        var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* RequestOptions */]({ headers: header });
125
+        this.http.delete(url, options).subscribe(function (result) {
126
+            console.log(result);
127
+            callback();
128
+        });
129
+    };
130
+    MessageProvider = __decorate([
131
+        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */])(),
132
+        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1__angular_http__["b" /* Http */], __WEBPACK_IMPORTED_MODULE_2__user_user__["a" /* UserProvider */]])
133
+    ], MessageProvider);
134
+    return MessageProvider;
135
+}());
136
+
137
+//# sourceMappingURL=message.js.map
138
+
139
+/***/ }),
140
+
141
+/***/ 200:
46 142
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
47 143
 
48 144
 "use strict";
49 145
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HomePage; });
50 146
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
51 147
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(32);
52
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__channel_channel__ = __webpack_require__(99);
148
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__channel_channel__ = __webpack_require__(50);
149
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_forms__ = __webpack_require__(15);
150
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__providers_user_user__ = __webpack_require__(79);
53 151
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
54 152
     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
55 153
     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -62,28 +160,52 @@ var __metadata = (this && this.__metadata) || function (k, v) {
62 160
 
63 161
 
64 162
 
163
+
164
+
65 165
 var HomePage = /** @class */ (function () {
66
-    function HomePage(navCtrl) {
166
+    function HomePage(navCtrl, formbuilder, userprovider) {
67 167
         this.navCtrl = navCtrl;
168
+        this.formbuilder = formbuilder;
169
+        this.userprovider = userprovider;
170
+        this.formgroup = this.formbuilder.group({ username: ['', __WEBPACK_IMPORTED_MODULE_3__angular_forms__["f" /* Validators */].required],
171
+            password: ['', __WEBPACK_IMPORTED_MODULE_3__angular_forms__["f" /* Validators */].required]
172
+        });
173
+        this.username = this.formgroup.controls['username'];
174
+        this.password = this.formgroup.controls['password'];
68 175
     }
69 176
     HomePage.prototype.login = function () {
70
-        this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_2__channel_channel__["a" /* ChannelPage */]);
177
+        this.navCtrl.setRoot(__WEBPACK_IMPORTED_MODULE_2__channel_channel__["a" /* ChannelPage */]);
178
+    };
179
+    HomePage.prototype.sendLogin = function (loginForm) {
180
+        var _this = this;
181
+        this.userprovider.login(loginForm.username, loginForm.password, function (result) {
182
+            if (result.status == 200) {
183
+                console.log("Success!");
184
+                _this.userprovider.setToken(result.headers.get("authorization"));
185
+                console.log(_this.userprovider.getToken());
186
+                _this.navCtrl.setRoot(__WEBPACK_IMPORTED_MODULE_2__channel_channel__["a" /* ChannelPage */]);
187
+            }
188
+            else {
189
+                console.log("invalid login attempt");
190
+            }
191
+        });
192
+    };
193
+    HomePage.prototype.setLoginForm = function () {
71 194
     };
72 195
     HomePage = __decorate([
73 196
         Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
74
-            selector: 'page-home',template:/*ion-inline-start:"/Users/jaehoonp/zipteamUIv2/src/pages/home/home.html"*/'<ion-header>\n\n</ion-header>\n\n<ion-content text-center class = "login">\n\n  <br><br><br><br><br>\n  <img src="../assets/imgs/fullLogo.png" alt="SLACK" class="rounded-corners">\n\n  <br><br><br><br>\n  \n<ion-list>\n\n  <ion-item text-center>\n\n    <ion-label fixed>Username</ion-label>\n    <ion-input type="text" value=""></ion-input>\n  </ion-item>\n\n  <ion-item text-center>\n    <ion-label fixed>Password</ion-label>\n    <ion-input type="password"></ion-input>\n  </ion-item>\n\n</ion-list>\n\n\n\n<button ion-button color="danger" round (click)="login()">Login</button>\n\n<!-- line break -->\n<br>\n\n<button ion-button color="danger" round>Sign Up</button>\n\n\n\n\n\n  <!-- Toggle menu button -->\n  <!-- <br>\n  <button ion-button secondary menuToggle>Toggle Menu</button>  -->\n</ion-content>\n'/*ion-inline-end:"/Users/jaehoonp/zipteamUIv2/src/pages/home/home.html"*/
197
+            selector: 'page-home',template:/*ion-inline-start:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/home/home.html"*/'<ion-header>\n</ion-header>\n\n\n\n<ion-content text-center class = "login">\n\n  <br><br><br><br><br>\n  <img src="../assets/imgs/fullLogo.png" alt="SLACK" class="rounded-corners">\n\n  <br><br><br><br>\n  \n\n\n  <form [formGroup]="formgroup" (ngSubmit)="sendLogin(formgroup.value)">\n\n<ion-list>\n\n  <ion-item text-center>\n\n\n    <ion-label fixed>Username</ion-label>\n    <ion-input type="text" formControlName="username"></ion-input>\n  </ion-item>\n\n  <ion-item text-center *ngIf="username.hasError(\'required\') && username.touched">\n    <p> *Please enter your username</p>\n  </ion-item>\n\n  <ion-item text-center>\n    <ion-label fixed>Password</ion-label>\n    <ion-input type="password" formControlName="password"></ion-input>\n  </ion-item>\n\n  <ion-item text-center *ngIf="password.hasError(\'required\') && password.touched">\n      <p> *Please enter your password</p>\n    </ion-item>\n\n\n</ion-list>\n\n\n\n\n<button ion-button color="danger" round type="submit">Login</button>\n\n<!-- line break -->\n<br>\n\n<button ion-button color="danger" round>Sign Up</button>\n\n\n</form>\n\n\n  <!-- <form [formGroup]="loginform" (ngSubmit)="sendLogin(loginForm.value)" *ngIf="loginForm">\n\n    <ion-label fixed>Username</ion-label>\n    <input type="text" name="name" formControlName="username">\n\n    <ion-label fixed>Password</ion-label>\n    <input type="text" name="name" formControlName="password">\n\n    <input type="submit" class="cta-btn filled" value="Submit" [disabled]="!loginForm.valid">\n   </form> -->\n\n\n\n\n\n  <!-- Toggle menu button -->\n  <!-- <br> -->\n  <button ion-button secondary menuToggle>Toggle Menu</button> \n  \n</ion-content>\n'/*ion-inline-end:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/home/home.html"*/
75 198
         }),
76
-        __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavController */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavController */]) === "function" && _a || Object])
199
+        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavController */], __WEBPACK_IMPORTED_MODULE_3__angular_forms__["a" /* FormBuilder */], __WEBPACK_IMPORTED_MODULE_4__providers_user_user__["a" /* UserProvider */]])
77 200
     ], HomePage);
78 201
     return HomePage;
79
-    var _a;
80 202
 }());
81 203
 
82 204
 //# sourceMappingURL=home.js.map
83 205
 
84 206
 /***/ }),
85 207
 
86
-/***/ 195:
208
+/***/ 201:
87 209
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
88 210
 
89 211
 "use strict";
@@ -128,7 +250,7 @@ var ListPage = /** @class */ (function () {
128 250
     };
129 251
     ListPage = ListPage_1 = __decorate([
130 252
         Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
131
-            selector: 'page-list',template:/*ion-inline-start:"/Users/jaehoonp/zipteamUIv2/src/pages/list/list.html"*/'<ion-header>\n  <ion-navbar>\n    <button ion-button menuToggle>\n      <ion-icon name="menu"></ion-icon>\n    </button>\n    <ion-title>List</ion-title>\n  </ion-navbar>\n</ion-header>\n\n<ion-content>\n  <ion-list>\n    <button ion-item *ngFor="let item of items" (click)="itemTapped($event, item)">\n      <ion-icon [name]="item.icon" item-start></ion-icon>\n      {{item.title}}\n      <div class="item-note" item-end>\n        {{item.note}}\n      </div>\n    </button>\n  </ion-list>\n  <div *ngIf="selectedItem" padding>\n    You navigated here from <b>{{selectedItem.title}}</b>\n  </div>\n</ion-content>\n'/*ion-inline-end:"/Users/jaehoonp/zipteamUIv2/src/pages/list/list.html"*/
253
+            selector: 'page-list',template:/*ion-inline-start:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/list/list.html"*/'<ion-header>\n  <ion-navbar>\n    <button ion-button menuToggle>\n      <ion-icon name="menu"></ion-icon>\n    </button>\n    <ion-title>List</ion-title>\n  </ion-navbar>\n</ion-header>\n\n<ion-content>\n  <ion-list>\n    <button ion-item *ngFor="let item of items" (click)="itemTapped($event, item)">\n      <ion-icon [name]="item.icon" item-start></ion-icon>\n      {{item.title}}\n      <div class="item-note" item-end>\n        {{item.note}}\n      </div>\n    </button>\n  </ion-list>\n  <div *ngIf="selectedItem" padding>\n    You navigated here from <b>{{selectedItem.title}}</b>\n  </div>\n</ion-content>\n'/*ion-inline-end:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/list/list.html"*/
132 254
         }),
133 255
         __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* NavParams */]])
134 256
     ], ListPage);
@@ -140,13 +262,13 @@ var ListPage = /** @class */ (function () {
140 262
 
141 263
 /***/ }),
142 264
 
143
-/***/ 196:
265
+/***/ 202:
144 266
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
145 267
 
146 268
 "use strict";
147 269
 Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
148
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__ = __webpack_require__(197);
149
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_module__ = __webpack_require__(219);
270
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__ = __webpack_require__(203);
271
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_module__ = __webpack_require__(223);
150 272
 
151 273
 
152 274
 Object(__WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__["a" /* platformBrowserDynamic */])().bootstrapModule(__WEBPACK_IMPORTED_MODULE_1__app_module__["a" /* AppModule */]);
@@ -154,20 +276,24 @@ Object(__WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__["a" /* pl
154 276
 
155 277
 /***/ }),
156 278
 
157
-/***/ 219:
279
+/***/ 223:
158 280
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
159 281
 
160 282
 "use strict";
161 283
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppModule; });
162
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser__ = __webpack_require__(30);
284
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser__ = __webpack_require__(26);
163 285
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
164 286
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ionic_angular__ = __webpack_require__(32);
165
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__app_component__ = __webpack_require__(262);
166
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pages_home_home__ = __webpack_require__(194);
167
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__pages_list_list__ = __webpack_require__(195);
168
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pages_channel_channel__ = __webpack_require__(99);
169
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ionic_native_status_bar__ = __webpack_require__(190);
170
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ionic_native_splash_screen__ = __webpack_require__(193);
287
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__app_component__ = __webpack_require__(265);
288
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pages_home_home__ = __webpack_require__(200);
289
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__pages_list_list__ = __webpack_require__(201);
290
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pages_channel_channel__ = __webpack_require__(50);
291
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ionic_native_status_bar__ = __webpack_require__(196);
292
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ionic_native_splash_screen__ = __webpack_require__(199);
293
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__providers_user_user__ = __webpack_require__(79);
294
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__angular_common_http__ = __webpack_require__(273);
295
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__angular_http__ = __webpack_require__(78);
296
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__providers_message_message__ = __webpack_require__(156);
171 297
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
172 298
     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
173 299
     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -183,6 +309,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
183 309
 
184 310
 
185 311
 
312
+
313
+
314
+
315
+
186 316
 var AppModule = /** @class */ (function () {
187 317
     function AppModule() {
188 318
     }
@@ -201,6 +331,8 @@ var AppModule = /** @class */ (function () {
201 331
                         { loadChildren: '../pages/channel/channel.module#ChannelPageModule', name: 'ChannelPage', segment: 'channel', priority: 'low', defaultHistory: [] }
202 332
                     ]
203 333
                 }),
334
+                __WEBPACK_IMPORTED_MODULE_10__angular_common_http__["a" /* HttpClientModule */],
335
+                __WEBPACK_IMPORTED_MODULE_11__angular_http__["c" /* HttpModule */]
204 336
             ],
205 337
             bootstrap: [__WEBPACK_IMPORTED_MODULE_2_ionic_angular__["a" /* IonicApp */]],
206 338
             entryComponents: [
@@ -212,7 +344,9 @@ var AppModule = /** @class */ (function () {
212 344
             providers: [
213 345
                 __WEBPACK_IMPORTED_MODULE_7__ionic_native_status_bar__["a" /* StatusBar */],
214 346
                 __WEBPACK_IMPORTED_MODULE_8__ionic_native_splash_screen__["a" /* SplashScreen */],
215
-                { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["u" /* ErrorHandler */], useClass: __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["b" /* IonicErrorHandler */] }
347
+                { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["u" /* ErrorHandler */], useClass: __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["b" /* IonicErrorHandler */] },
348
+                __WEBPACK_IMPORTED_MODULE_9__providers_user_user__["a" /* UserProvider */],
349
+                __WEBPACK_IMPORTED_MODULE_12__providers_message_message__["a" /* MessageProvider */]
216 350
             ]
217 351
         })
218 352
     ], AppModule);
@@ -223,18 +357,18 @@ var AppModule = /** @class */ (function () {
223 357
 
224 358
 /***/ }),
225 359
 
226
-/***/ 262:
360
+/***/ 265:
227 361
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
228 362
 
229 363
 "use strict";
230 364
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MyApp; });
231 365
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
232 366
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(32);
233
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_native_status_bar__ = __webpack_require__(190);
234
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_native_splash_screen__ = __webpack_require__(193);
235
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pages_home_home__ = __webpack_require__(194);
236
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__pages_list_list__ = __webpack_require__(195);
237
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pages_channel_channel__ = __webpack_require__(99);
367
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_native_status_bar__ = __webpack_require__(196);
368
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_native_splash_screen__ = __webpack_require__(199);
369
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pages_home_home__ = __webpack_require__(200);
370
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__pages_list_list__ = __webpack_require__(201);
371
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pages_channel_channel__ = __webpack_require__(50);
238 372
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
239 373
     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
240 374
     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -284,7 +418,7 @@ var MyApp = /** @class */ (function () {
284 418
         __metadata("design:type", __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* Nav */])
285 419
     ], MyApp.prototype, "nav", void 0);
286 420
     MyApp = __decorate([
287
-        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({template:/*ion-inline-start:"/Users/jaehoonp/zipteamUIv2/src/app/app.html"*/'<ion-menu [content]="content">\n  <ion-header>\n    <ion-toolbar>\n      <ion-title>Menu</ion-title>\n    </ion-toolbar>\n  </ion-header>\n\n  <ion-content>\n    <ion-list>\n      <button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">\n        {{p.title}}\n      </button>\n    </ion-list>\n  </ion-content>\n\n</ion-menu>\n\n<!-- Disable swipe-to-go-back because it\'s poor UX to combine STGB with side menus -->\n<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>'/*ion-inline-end:"/Users/jaehoonp/zipteamUIv2/src/app/app.html"*/
421
+        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({template:/*ion-inline-start:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/app/app.html"*/'\n\n\n\n\n\n<ion-menu [content]="content">\n  <ion-header>\n    <ion-toolbar>\n      <ion-title>Zip-Slack</ion-title>\n    </ion-toolbar>\n  </ion-header>\n\n  <ion-content>\n    <ion-list>\n      <button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">\n        {{p.title}}\n      </button>\n    </ion-list>\n\n\n\n\n  </ion-content>\n\n</ion-menu>\n\n<!-- Disable swipe-to-go-back because it\'s poor UX to combine STGB with side menus -->\n<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>\n\n\n\n'/*ion-inline-end:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/app/app.html"*/
288 422
         }),
289 423
         __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* Platform */], __WEBPACK_IMPORTED_MODULE_2__ionic_native_status_bar__["a" /* StatusBar */], __WEBPACK_IMPORTED_MODULE_3__ionic_native_splash_screen__["a" /* SplashScreen */]])
290 424
     ], MyApp);
@@ -295,13 +429,14 @@ var MyApp = /** @class */ (function () {
295 429
 
296 430
 /***/ }),
297 431
 
298
-/***/ 99:
432
+/***/ 50:
299 433
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
300 434
 
301 435
 "use strict";
302 436
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ChannelPage; });
303 437
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
304 438
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(32);
439
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__providers_message_message__ = __webpack_require__(156);
305 440
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
306 441
     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
307 442
     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -313,6 +448,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
313 448
 };
314 449
 
315 450
 
451
+
316 452
 /**
317 453
  * Generated class for the ChannelPage page.
318 454
  *
@@ -320,25 +456,105 @@ var __metadata = (this && this.__metadata) || function (k, v) {
320 456
  * Ionic pages and navigation.
321 457
  */
322 458
 var ChannelPage = /** @class */ (function () {
323
-    function ChannelPage(navCtrl, navParams) {
459
+    function ChannelPage(navCtrl, navParams, messageProvider) {
324 460
         this.navCtrl = navCtrl;
325 461
         this.navParams = navParams;
462
+        this.messageProvider = messageProvider;
463
+        this.messages = [
464
+            {
465
+                message: "Hello"
466
+            },
467
+            {
468
+                message: "sup"
469
+            }
470
+        ];
471
+        this.getMessages();
326 472
     }
327 473
     ChannelPage.prototype.ionViewDidLoad = function () {
328 474
         console.log('ionViewDidLoad ChannelPage');
329 475
     };
476
+    ChannelPage.prototype.getMessages = function () {
477
+        var _this = this;
478
+        this.messageProvider.get(1, function (after) {
479
+            _this.messages = after;
480
+        });
481
+    };
482
+    ChannelPage.prototype.deleteMessage = function (messageId) {
483
+        var _this = this;
484
+        this.messageProvider.delete(messageId, function (after) {
485
+            _this.getMessages();
486
+        });
487
+    };
330 488
     ChannelPage = __decorate([
331 489
         Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
332
-            selector: 'page-channel',template:/*ion-inline-start:"/Users/jaehoonp/zipteamUIv2/src/pages/channel/channel.html"*/'<!--\n  Generated template for the ChannelPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n\n  <ion-navbar>\n    <ion-title>channel</ion-title>\n  </ion-navbar>\n\n</ion-header>\n\n\n<ion-content padding>\n\n</ion-content>\n'/*ion-inline-end:"/Users/jaehoonp/zipteamUIv2/src/pages/channel/channel.html"*/,
490
+            selector: 'page-channel',template:/*ion-inline-start:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/channel/channel.html"*/'\n\n\n<!-- <ion-buttons start>\n\n  <button ion-button icon-only menuToggle>\n\n    <ion-icon name="menu"></ion-icon>\n\n  </button>\n\n</ion-buttons> -->\n\n\n\n<ion-header>\n\n  <ion-navbar>\n    <ion-title>Channel</ion-title>\n\n    <ion-buttons start>\n\n        <button ion-button icon-only menuToggle>\n      \n          <ion-icon name="menu"></ion-icon>\n      \n        </button>\n      \n      </ion-buttons>\n  </ion-navbar>\n\n</ion-header>\n\n\n\n<ion-content padding>\n\n    <ion-list padding>\n      <ion-item-sliding *ngFor="let message of messages">\n        <ion-item>{{message.message}}</ion-item>\n    \n        <ion-item-options side="right">\n   \n            <button ion-button>\n                <ion-icon name="settings"></ion-icon>\n              </button>\n   \n            <!-- <button color="danger" ion-button (click)="deleteMessage(todo.id)">\n              <ion-icon name="trash"></ion-icon>\n            </button> -->\n   \n        </ion-item-options>\n      </ion-item-sliding>\n      \n      <!-- <ion-item>Todo 2</ion-item>\n      <ion-item>Todo 3</ion-item> -->\n    </ion-list>\n   \n   </ion-content>\n\n'/*ion-inline-end:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/channel/channel.html"*/,
333 491
         }),
334
-        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* NavParams */]])
492
+        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* NavParams */],
493
+            __WEBPACK_IMPORTED_MODULE_2__providers_message_message__["a" /* MessageProvider */]])
335 494
     ], ChannelPage);
336 495
     return ChannelPage;
337 496
 }());
338 497
 
339 498
 //# sourceMappingURL=channel.js.map
340 499
 
500
+/***/ }),
501
+
502
+/***/ 79:
503
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
504
+
505
+"use strict";
506
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UserProvider; });
507
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
508
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_http__ = __webpack_require__(78);
509
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
510
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
511
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
512
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
513
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
514
+};
515
+var __metadata = (this && this.__metadata) || function (k, v) {
516
+    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
517
+};
518
+
519
+
520
+/*
521
+  Generated class for the UserProvider provider.
522
+
523
+  See https://angular.io/guide/dependency-injection for more info on providers
524
+  and Angular DI.
525
+*/
526
+var UserProvider = /** @class */ (function () {
527
+    function UserProvider(http) {
528
+        this.http = http;
529
+        console.log('Hello UserProvider Provider');
530
+    }
531
+    UserProvider.prototype.getToken = function () { return this.token; };
532
+    UserProvider.prototype.setToken = function (token) { this.token = token; };
533
+    UserProvider.prototype.login = function (username, password, callback) {
534
+        var url = "http://localhost:8080/login";
535
+        var header = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["a" /* Headers */]({
536
+            'content-type': 'application/json',
537
+        });
538
+        var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* RequestOptions */]({ headers: header });
539
+        var body = {
540
+            "username": username,
541
+            "password": password
542
+        };
543
+        this.http.post(url, body, options).subscribe(function (result) {
544
+            callback(result);
545
+            //console.log(result.headers.get("authorization"));
546
+        });
547
+    };
548
+    UserProvider = __decorate([
549
+        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */])(),
550
+        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1__angular_http__["b" /* Http */]])
551
+    ], UserProvider);
552
+    return UserProvider;
553
+}());
554
+
555
+//# sourceMappingURL=user.js.map
556
+
341 557
 /***/ })
342 558
 
343
-},[196]);
559
+},[202]);
344 560
 //# sourceMappingURL=main.js.map

+ 1
- 1
www/build/main.js.map
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 32056
- 26142
www/build/vendor.js
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 1
- 1
www/build/vendor.js.map
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 3
- 0
www/index.html Целия файл

@@ -1,6 +1,9 @@
1 1
 <!DOCTYPE html>
2 2
 <html lang="en" dir="ltr">
3 3
 <head>
4
+  <script data-ionic="inject">
5
+    (function(w){var i=w.Ionic=w.Ionic||{};i.version='3.9.2';i.angular='5.2.11';i.staticDir='build/';})(window);
6
+  </script>
4 7
   <meta charset="UTF-8">
5 8
   <title>Ionic App</title>
6 9
   <meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">