routes.js
$routeProvider.when('/leads/:id/edit', {
templateUrl: '/leads/:id/edit',
controller: 'LeadEditController',
factory: ['LeadFactory'],
resolve: {
load: ['$q', '$rootScope',
function ($q, $rootScope) {
var deferred = $q.defer();
require(['app/controllers/LeadEditController',
'app/factories/LeadFactory',
], function () {
$rootScope.$apply(function () {
deferred.resolve();
});
})} ]
}
});
LeadEditController
define(['app/app'], function (app) {
'use strict';
app.register.controller('LeadEditController', ['$scope','leadFactory','$route',
function ($scope,leadFactory,$route) {
var url_params = $route.current.params;
console.log(url_params);
}]);
});
** Larvel controller funuction code **
public function edit($id)
{
$lead = $this->contract->singleLeadData($id);
$data = Response::json(array('status' => true,'lead' => $lead));
return View::make( 'leads.edit' )->with('lead',$data);
}
** The error i am getting **/
SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: \":id\"
I see that i am not able to pass id
value to the server side code.
How can i send the id value?