2014-10-28 41 views
0

如何在SamularJS等AngularJS中創建路線?像SammyJS,Grapnel或Satnav的AngularJS路線?

實施例:

.config(function($routeProvider) { 
    $routeProvider 
     .when('/photos/:date', { 
      controller: function($scope) { 
       // foo 
      }); 

}); 

我不需要模板或NG-視圖,我需要執行一個AJAX請求和打開一個模式,例如。

有什麼想法? TKS傢伙

回答

0
.config(function($routeProvider) { 
    $routeProvider 
     .when('/photos/:date', { 
      templateUrl: 'someView.html', 
      controller: function($scope,$http) { 

       $http.get('/someUlr').then(function(res){}); 
      }); 

}); 

試試這個

+0

什麼也沒有發生:/ – 2014-10-28 11:40:53