1、路由的迁移
/* --- v1 ----*/ .config(function($stateProvider){
$stateProvider
.state('main', {
url: '/',
templateUrl: 'templates/main.html',
controller: 'MainCtrl'
})
}) .controller('MainCtrl', function(){ }) /* --- v1 ----*/
/* --- v2 ----*/ @Page({
templateUrl:'main/main.html'
})
export class MainCmp {
constructor(){ }
} /* --- v2 ----*/
2、控制器的迁移
/* --- v1 ----*/ .controller('MainCtrl', function(){
this.data ={
text: 'Hello World'
}
}) /* --- v1 ----*/
/* --- v2 ----*/ export class MainCtrl{
constructor(){
this.data ={
text: 'Hello World'
}
}
} /* --- v2 ----*/