I have this: 

```js
$location.path() // categoria/1-ropa
```

I want just the id (is 1 in this case)

```js
var path = $location.path().substr(10, $location.path().length); 
var idBusqueda = path.substr(0, path.indexOf('-'));
```

with this i do that, but i want know if i can do it in one line?

Greets