1、路由的迁移
1 /* --- v1 ----*/ 2 3 .config(function($stateProvider){ 4 $stateProvider 5 .state('main', { 6 url: '/', 7 templateUrl: 'templates/main.html', 8 controller: 'MainCtrl' 9 }) 10 }) 11 12 .controller('MainCtrl', function(){ 13 14 }) 15 16 /* --- v1 ----*/
1 /* --- v2 ----*/ 2 3 @Page({ 4 templateUrl:'main/main.html' 5 }) 6 export class MainCmp { 7 constructor(){ 8 9 } 10 } 11 12 /* --- v2 ----*/
2、控制器的迁移
/* --- v1 ----*/ .controller('MainCtrl', function(){ this.data ={ text: 'Hello World' } }) /* --- v1 ----*/
/* --- v2 ----*/ export class MainCtrl{ constructor(){ this.data ={ text: 'Hello World' } } } /* --- v2 ----*/