{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/151","repository_url":"https://api.github.com/repos/ga-wdi-exercises/project3","labels_url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/151/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/151/comments","events_url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/151/events","html_url":"https://github.com/ga-wdi-exercises/project3/issues/151","id":146444949,"number":151,"title":"Angular Redirects","user":{"login":"ssatyal","id":15223550,"avatar_url":"https://avatars.githubusercontent.com/u/15223550?v=3","gravatar_id":"","url":"https://api.github.com/users/ssatyal","html_url":"https://github.com/ssatyal","followers_url":"https://api.github.com/users/ssatyal/followers","following_url":"https://api.github.com/users/ssatyal/following{/other_user}","gists_url":"https://api.github.com/users/ssatyal/gists{/gist_id}","starred_url":"https://api.github.com/users/ssatyal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssatyal/subscriptions","organizations_url":"https://api.github.com/users/ssatyal/orgs","repos_url":"https://api.github.com/users/ssatyal/repos","events_url":"https://api.github.com/users/ssatyal/events{/privacy}","received_events_url":"https://api.github.com/users/ssatyal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-06T21:46:24Z","updated_at":"2016-04-06T22:10:59Z","closed_at":null,"body":"Hey all (aka Robin),\r\n\r\nTrying to add redirects for creation of a trip (redirect the the new \"trips/:id\") and for adding locations on the trip show page (i.e. pushing the item up on the page I think).\r\n\r\nWe could theoretically do the second one the hacky way, but I'd rather do both of these the right Angular way (no page reloads). What would be the best way to implement this?\r\n\r\n***************************\r\napp/assets/javascripts/trips.js\r\n***************************\r\nNew trip creation happens in this directive (lines 140-166):\r\n```js\r\nfunction tripFormDirectiveFunction(Trip){\r\n    return{\r\n      templateUrl: \"/ng-views/_trip_form.html\",\r\n      restrict: \"C\",\r\n      scope: {\r\n        trip: \"=\",\r\n        formType: \"@\",\r\n      },\r\n      link: function(scope){\r\n        scope.create = function(){\r\n          Trip.save(scope.trip, function(response){\r\n            Trip.all.push(response);\r\n          });\r\n        }\r\n        scope.update = function(){\r\n          Trip.update({id: scope.trip.id}, scope.trip, function(response){\r\n            console.log(\"Success\")\r\n          })\r\n        }\r\n        scope.delete = function(){\r\n          Trip.delete({id: scope.trip.id}, scope.trip, function(response){\r\n            console.log(\"Success\")\r\n          })\r\n        }\r\n      }\r\n    }\r\n  }\r\n```\r\n********************************************************************************************\r\n\r\nand new locations are added via in the Trip show controller (70-72):\r\n\r\n```js\r\n  function showCtrlFunction( Search, Trip, $stateParams, LocationFactory ){\r\n    var showVM = this;\r\n    showVM.trip = Trip.get({id: $stateParams.id});\r\n    showVM.search = function() {\r\n      showVM.places = Search.query({q:showVM.query}, function(results){\r\n        showVM.places = results;\r\n        console.log(results)\r\n      })\r\n    };\r\n    showVM.location = new LocationFactory();\r\n    showVM.createLocation = function(trip_id, name, lat, long, place_id){\r\n      showVM.location.$save({trip_id: trip_id, name: name, lat: lat, long: long, place_id: place_id});\r\n    }\r\n  };\r\n```"},"comment":{"url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/comments/206592165","html_url":"https://github.com/ga-wdi-exercises/project3/issues/151#issuecomment-206592165","issue_url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/151","id":206592165,"user":{"login":"RobertAKARobin","id":6268177,"avatar_url":"https://avatars.githubusercontent.com/u/6268177?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertAKARobin","html_url":"https://github.com/RobertAKARobin","followers_url":"https://api.github.com/users/RobertAKARobin/followers","following_url":"https://api.github.com/users/RobertAKARobin/following{/other_user}","gists_url":"https://api.github.com/users/RobertAKARobin/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertAKARobin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertAKARobin/subscriptions","organizations_url":"https://api.github.com/users/RobertAKARobin/orgs","repos_url":"https://api.github.com/users/RobertAKARobin/repos","events_url":"https://api.github.com/users/RobertAKARobin/events{/privacy}","received_events_url":"https://api.github.com/users/RobertAKARobin/received_events","type":"User","site_admin":false},"created_at":"2016-04-06T22:10:58Z","updated_at":"2016-04-06T22:10:58Z","body":"Can you use `$state.go`? https://github.com/ga-wdi-lessons/angular-routing#state"}}