Commit 7bdf7c8671fda9117b3a841647ad8be06b61c2cd
Exists in
master
and in
1 other branch
Merge branch 'ngforward' of softwarepublico.gov.br:noosfero-themes/angular-theme into ngforward
Showing
3 changed files
with
31 additions
and
32 deletions
Show diff stats
src/app/index.ts
| @@ -4,7 +4,7 @@ import {noosferoModuleConfig} from "./index.config"; | @@ -4,7 +4,7 @@ import {noosferoModuleConfig} from "./index.config"; | ||
| 4 | import {noosferoAngularRunBlock} from "./index.run"; | 4 | import {noosferoAngularRunBlock} from "./index.run"; |
| 5 | import {routeConfig} from "./index.route"; | 5 | import {routeConfig} from "./index.route"; |
| 6 | import {ContentViewerController} from "./content-viewer/content-viewer.controller"; | 6 | import {ContentViewerController} from "./content-viewer/content-viewer.controller"; |
| 7 | -import {Main} from "./main/main.controller"; | 7 | +import {Main} from "./main/main.component"; |
| 8 | import {bootstrap, bundle} from 'ng-forward'; | 8 | import {bootstrap, bundle} from 'ng-forward'; |
| 9 | 9 | ||
| 10 | declare var moment: any; | 10 | declare var moment: any; |
| @@ -59,4 +59,4 @@ require("./profile/profile.controller.js"); | @@ -59,4 +59,4 @@ require("./profile/profile.controller.js"); | ||
| 59 | 59 | ||
| 60 | // NoosferoApp.addController("ContentViewerController", ContentViewerController); | 60 | // NoosferoApp.addController("ContentViewerController", ContentViewerController); |
| 61 | 61 | ||
| 62 | -// NoosferoApp.addConfig(routeConfig); | 62 | +NoosferoApp.addConfig(routeConfig); |
| @@ -0,0 +1,29 @@ | @@ -0,0 +1,29 @@ | ||
| 1 | +import {bundle, Component, StateConfig} from 'ng-forward'; | ||
| 2 | + | ||
| 3 | +@Component({ | ||
| 4 | + selector: 'main-content', | ||
| 5 | + templateUrl: "app/main/main.html", | ||
| 6 | +}) | ||
| 7 | +export class MainContent { | ||
| 8 | + | ||
| 9 | +} | ||
| 10 | + | ||
| 11 | +@Component({ | ||
| 12 | + selector: 'main', | ||
| 13 | + template: '<div ng-view></div>' | ||
| 14 | +}) | ||
| 15 | +@StateConfig([ | ||
| 16 | + { | ||
| 17 | + url: '/', | ||
| 18 | + component: MainContent, | ||
| 19 | + name: 'main', | ||
| 20 | + resolve: { | ||
| 21 | + currentUser: function(AuthService) { | ||
| 22 | + return AuthService.loginFromCookie(); | ||
| 23 | + } | ||
| 24 | + } | ||
| 25 | + } | ||
| 26 | +]) | ||
| 27 | +export class Main { | ||
| 28 | + | ||
| 29 | +} |
src/app/main/main.controller.ts
| @@ -1,30 +0,0 @@ | @@ -1,30 +0,0 @@ | ||
| 1 | -import {bundle, Component, StateConfig} from 'ng-forward'; | ||
| 2 | - | ||
| 3 | -@Component({ | ||
| 4 | - selector: 'main2', | ||
| 5 | - template: `test main2` | ||
| 6 | -}) | ||
| 7 | -export class Main2 { | ||
| 8 | - | ||
| 9 | -} | ||
| 10 | - | ||
| 11 | -@Component({ | ||
| 12 | - selector: 'main', | ||
| 13 | - template: `aaaa <ui-view></ui-view>` | ||
| 14 | -}) | ||
| 15 | -@StateConfig([ | ||
| 16 | - { | ||
| 17 | - url: '/', | ||
| 18 | - component: Main2, | ||
| 19 | - // templateUrl: "app/main/main.html", | ||
| 20 | - name: 'main', | ||
| 21 | - // resolve: { | ||
| 22 | - // currentUser: function(AuthService) { | ||
| 23 | - // return AuthService.loginFromCookie(); | ||
| 24 | - // } | ||
| 25 | - // } | ||
| 26 | - } | ||
| 27 | -]) | ||
| 28 | -export class Main { | ||
| 29 | - | ||
| 30 | -} |