forked from Minds/mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat): support single newsfeed routes
- Loading branch information
1 parent
92e6a20
commit 2f18249
Showing
7 changed files
with
77 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { TabsComponent } from './src/modules/tabs/tabs.component'; | ||
import { NewsfeedSingleComponent } from './src/modules/newsfeed/single.component'; | ||
import { ChannelComponent } from './src/modules/channel/channel.component'; | ||
import { LoginComponent } from './src/modules/auth/login.component'; | ||
|
||
export const routes = [ | ||
{ path: "", redirectTo: "/login", pathMatch: "full", terminal: true }, | ||
{ path: "login", component: LoginComponent }, | ||
{ path: "tab/:id", component: TabsComponent }, | ||
{ path: "newsfeed/:id", component: NewsfeedSingleComponent } | ||
{ path: "channel/:id", component: ChannelComponent } | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Component, OnInit, OnDestroy } from '@angular/core'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { Client } from '../../common/services/api/client'; | ||
|
||
|
||
@Component({ | ||
selector: 'newsfeed-single', | ||
template: ` | ||
<StackLayout> | ||
<activity [entity]="entity" *ngIf="entity"></activity> | ||
</StackLayout> | ||
` | ||
}) | ||
|
||
export class NewsfeedSingleComponent { | ||
|
||
guid : string; | ||
entity; | ||
inProgress : boolean = false; | ||
|
||
constructor(private client : Client, private route : ActivatedRoute){} | ||
|
||
ngOnInit(){ | ||
this.route.params.subscribe((params) => { | ||
this.guid = params['id']; | ||
this.entity = null; | ||
this.load(); | ||
}); | ||
} | ||
|
||
load(){ | ||
this.inProgress = true; | ||
this.client.get('api/v1/newsfeed/single/' + this.guid, {}) | ||
.then((response : any) => { | ||
this.entity = response.activity; | ||
}); | ||
} | ||
|
||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters