You can't use only $stateProvider
.
You need to inject $urlRouterProvider
and create a code similar to:
$urlRouterProvider.otherwise('/otherwise');
The /otherwise
url must be defined on a state as usual:
$stateProvider
.state("otherwise", { url : '/otherwise'...})
See this link where ksperling explains
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…