Commit 2b9b97cb808ec198ab9e358a5b3d878b56ff3130

Authored by Victor Costa
1 parent d3a3844a

Migrating main controller

src/app/index.module.ts
  1 +import {Main} from "./main/main.controller";
  2 +
1 export class NoosferoApp { 3 export class NoosferoApp {
2 4
3 - static appName: string = "noosferoApp"; 5 + static appName: string = (<any>Main).name;
4 6
5 static init() { 7 static init() {
6 angular.module(NoosferoApp.appName, ["ngAnimate", "ngCookies", "ngStorage", "ngTouch", 8 angular.module(NoosferoApp.appName, ["ngAnimate", "ngCookies", "ngStorage", "ngTouch",
src/app/index.ts
@@ -51,4 +51,4 @@ declare var moment: any; @@ -51,4 +51,4 @@ declare var moment: any;
51 51
52 // NoosferoApp.addConfig(routeConfig); 52 // NoosferoApp.addConfig(routeConfig);
53 53
54 -bootstrap(Main, ['ui.router']); 54 +console.log(bootstrap(Main, ['ui.router']));
src/app/main/main.controller.ts
1 import {Component, StateConfig} from 'ng-forward'; 1 import {Component, StateConfig} from 'ng-forward';
2 2
3 @Component({ 3 @Component({
  4 + selector: 'main2',
  5 + template: `test main2`
  6 +})
  7 +export class Main2 {
  8 +
  9 +}
  10 +
  11 +@Component({
4 selector: 'main', 12 selector: 'main',
5 template: `aaaa <div ui-view></div>` 13 template: `aaaa <div ui-view></div>`
6 }) 14 })
@@ -9,7 +17,7 @@ import {Component, StateConfig} from &#39;ng-forward&#39;; @@ -9,7 +17,7 @@ import {Component, StateConfig} from &#39;ng-forward&#39;;
9 url: '/', 17 url: '/',
10 component: Main2, 18 component: Main2,
11 // templateUrl: "app/main/main.html", 19 // templateUrl: "app/main/main.html",
12 - name: 'main2', 20 + name: 'main',
13 // resolve: { 21 // resolve: {
14 // currentUser: function(AuthService) { 22 // currentUser: function(AuthService) {
15 // return AuthService.loginFromCookie(); 23 // return AuthService.loginFromCookie();
@@ -20,11 +28,3 @@ import {Component, StateConfig} from &#39;ng-forward&#39;; @@ -20,11 +28,3 @@ import {Component, StateConfig} from &#39;ng-forward&#39;;
20 export class Main { 28 export class Main {
21 29
22 } 30 }
23 -  
24 -@Component({  
25 - selector: 'Main2',  
26 - template: `test main2`  
27 -})  
28 -export class Main2 {  
29 -  
30 -}  
src/app/main/main.html
1 <acme-navbar></acme-navbar> 1 <acme-navbar></acme-navbar>
2 <div ui-view="content"></div> 2 <div ui-view="content"></div>
3 -asdas dasd asdas d