I am getting

Error: [$location:ihshprfx] Invalid url "http://localhost:3000/#", missing hash prefix "#!". http://errors.angularjs.org/1.2.16/$location/ihshprfx?p0=http%3A%2F%2Flocalhost%3A3000%2F%23&p1=%23

after delete function:

$scope.delete = function(venue) {
  venue.$remove();
};

but venue is successfully removed. What could be wrong?

UPDATE: I saw that in a dropdown I wrote href = '#' . But when I delete it, nothing happens. How I can call directive from a tag?

  <a href='#' ng-click="remove(venue)">Delete</a>
有帮助吗?

解决方案

Your ng-click calls a function called remove while your scope method is titled delete. Because it can't find the function you've set, I believe Angular doesn't to prevent the default event, which sends the user to '#', which is not valid based on your hash prefix settings.

If you match the function call to the method name, I think you should be fine.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top