Monday, February 10, 2014

Cake and Angular Question

Looking deeper into updating a site to use Angular.js but first thing I noticed was looking at the demo here http://docs.angularjs.org/tutorial  that in the app.js it references using html partials (element in Cake terms):

 

phonecatApp.config(['$routeProvider',

  function($routeProvider) {

    $routeProvider.

      when('/phones', {

        templateUrl: 'partials/phone-list.html',

        controller: 'PhoneListCtrl'

      }).

      when('/phones/:phoneId', {

        templateUrl: 'partials/phone-detail.html',

        controller: 'PhoneDetailCtrl'

      }).

      otherwise({

        redirectTo: '/phones'

      });

  }]);

 

Is there a way to use Cakes elements instead?

                                                                                                                                                                                                                                                        

Seems like having an element to show each record then when added / modified the exact same code in html format rather than .ctp is just wrong.

 

No comments: