Commit deef855acf7d0ea2ec7ad2e60466b63927bdc641
1 parent
b0b90c13
Exists in
master
and in
34 other branches
Refactor routes and not add router components as controllers
Showing
3 changed files
with
7 additions
and
23 deletions
Show diff stats
src/app/index.ts
| 1 | - | |
| 2 | - | |
| 3 | 1 | import {NoosferoApp} from "./index.module"; |
| 4 | 2 | import {noosferoModuleConfig} from "./index.config"; |
| 5 | 3 | import {noosferoAngularRunBlock} from "./index.run"; |
| 6 | 4 | import {routeConfig} from "./index.route"; |
| 7 | 5 | |
| 8 | -import {ContentViewer as noosferoContentViewer} from "./content-viewer/content-viewer.component"; | |
| 9 | -import {ContentViewerActions as noosferoContentViewerActions} from "./content-viewer/content-viewer-actions.component"; | |
| 10 | -import {Profile as noosferoProfile} from "./profile/profile.component"; | |
| 11 | -import {ProfileInfo as noosferoProfileInfo} from "./profile-info/profile-info.component"; | |
| 12 | -import {ProfileHome as noosferoProfileHome} from "./profile/profile-home.component"; | |
| 13 | -import {Cms as noosferoCms} from "./cms/cms.component"; | |
| 14 | - | |
| 15 | 6 | import {Main} from "./main/main.component"; |
| 16 | 7 | import {bootstrap, bundle} from "ng-forward"; |
| 17 | 8 | |
| ... | ... | @@ -41,15 +32,7 @@ NoosferoApp.run(noosferoAngularRunBlock); |
| 41 | 32 | // NoosferoApp.addService("AuthService", AuthService); |
| 42 | 33 | NoosferoApp.addController("AuthController", AuthController); |
| 43 | 34 | |
| 44 | - | |
| 45 | 35 | require("./components/noosfero/noosfero.service.js"); |
| 46 | 36 | require("./components/noosfero/profile-image/profile-image.component.js"); |
| 47 | 37 | |
| 48 | -NoosferoApp.addController("ContentViewerController", noosferoContentViewer); | |
| 49 | -NoosferoApp.addController("ContentViewerActionsController", noosferoContentViewerActions); | |
| 50 | -NoosferoApp.addController("ProfileController", noosferoProfile); | |
| 51 | -NoosferoApp.addController("ProfileHomeController", noosferoProfileHome); | |
| 52 | -NoosferoApp.addController("ProfileInfoController", noosferoProfileInfo); | |
| 53 | -NoosferoApp.addController("CmsController", noosferoCms); | |
| 54 | - | |
| 55 | 38 | NoosferoApp.addConfig(routeConfig); | ... | ... |
src/app/main/main.component.ts
src/app/profile/profile.component.ts
| ... | ... | @@ -3,6 +3,7 @@ import {ProfileInfo} from '../profile-info/profile-info.component'; |
| 3 | 3 | import {ProfileHome} from '../profile/profile-home.component'; |
| 4 | 4 | import {Cms} from '../cms/cms.component'; |
| 5 | 5 | import {ContentViewer} from "../content-viewer/content-viewer.component"; |
| 6 | +import {ContentViewerActions} from "../content-viewer/content-viewer-actions.component"; | |
| 6 | 7 | import {NoosferoActivities} from "../components/noosfero-activities/activities.component"; |
| 7 | 8 | import {ProfileService} from "../../lib/ng-noosfero-api/http/profile.service"; |
| 8 | 9 | |
| ... | ... | @@ -21,7 +22,7 @@ import * as noosferoModels from "./../models/interfaces"; |
| 21 | 22 | views: { |
| 22 | 23 | "mainBlockContent": { |
| 23 | 24 | templateUrl: "app/profile-info/profile-info.html", |
| 24 | - controller: "ProfileInfoController", | |
| 25 | + controller: ProfileInfo, | |
| 25 | 26 | controllerAs: "vm" |
| 26 | 27 | } |
| 27 | 28 | } |
| ... | ... | @@ -33,7 +34,7 @@ import * as noosferoModels from "./../models/interfaces"; |
| 33 | 34 | views: { |
| 34 | 35 | "mainBlockContent": { |
| 35 | 36 | templateUrl: "app/cms/cms.html", |
| 36 | - controller: "CmsController", | |
| 37 | + controller: Cms, | |
| 37 | 38 | controllerAs: "vm" |
| 38 | 39 | } |
| 39 | 40 | } |
| ... | ... | @@ -44,7 +45,7 @@ import * as noosferoModels from "./../models/interfaces"; |
| 44 | 45 | component: ProfileHome, |
| 45 | 46 | views: { |
| 46 | 47 | "mainBlockContent": { |
| 47 | - controller: "ProfileHomeController", | |
| 48 | + controller: ProfileHome, | |
| 48 | 49 | controllerAs: "vm" |
| 49 | 50 | } |
| 50 | 51 | } |
| ... | ... | @@ -56,12 +57,12 @@ import * as noosferoModels from "./../models/interfaces"; |
| 56 | 57 | views: { |
| 57 | 58 | "mainBlockContent": { |
| 58 | 59 | templateUrl: "app/content-viewer/page.html", |
| 59 | - controller: "ContentViewerController", | |
| 60 | + controller: ContentViewer, | |
| 60 | 61 | controllerAs: "vm" |
| 61 | 62 | }, |
| 62 | 63 | "actions@main": { |
| 63 | 64 | templateUrl: "app/content-viewer/navbar-actions.html", |
| 64 | - controller: "ContentViewerActionsController", | |
| 65 | + controller: ContentViewerActions, | |
| 65 | 66 | controllerAs: "vm" |
| 66 | 67 | } |
| 67 | 68 | } | ... | ... |