This is a sample Spotify app demoing routing through AngularJS, based on ngRoute example.
Routing in Spotify Apps is normally carried out throough Spotify URIs (spotify:app::<something_else>). For AngularJS to work properly with these, ngRoute
and $location
need to be modified.
However, you can use normal hashbang navigation in a Spotify App that AngularJS understands without overriding anything, as the demo shows.
- Sign up for a developer account on Spotify by logging in and agreeing to the terms of use.
- Create the Spotify folder if it doesn't exist already:
~/Spotify
(Mac OS X and Linux) orMy Documents\Spotify
(Windows). - Open the Spotify folder.
- Run
git clone git://github.com/spotify/spotify-angular-app
. - Download the latest version of Spotify.
- Open Spotify and type "spotify:app:spotify-angular" in the search bar (restart Spotify completely in case it doesn't find the App at first).
Add custom directives for Views Framework like <spotify-player>
or <spotify-listview>
.