Giter VIP home page Giter VIP logo

ng-music's Introduction

Angular Routing with UI-Router

Routing in the front-end can be just as important as routing on the back-end. UI-Router is one of the most popular routers for angular and is a staple for every angular application.

You are going to be dropped into an application that already has a few things set up for you.

You currently have a MusicService that is populated with data but.... the service does not know how to return anything to any of the controllers.

####Step 1 Get the Service and Controllers Talking

The albumsComponent and view have already been set up and are completely functional as long as your service and routes are working correctly.

Start with the MusicService and then follow the comments from there.

###Step 2 Album Component

The end goal for this application is to have it function similarly to Amazon or Itunes. Typically you will see a url look something like this.

var url = {
  protocol: 'https://',
  domain: 'www.amazon.com',
  resource: 'product',
  itemId: 'B00ZMVGTA2'
  full:"https://www.amazon.com/gp/product/B00ZMVGTA2"
  }                         // ^^ Not sure what that is there for ???

One of the main reasons for building a url like this is so we can share links that will can dictate the exact state of an application.

Your goal is to build out this music app so you can share a link and send someone directly to your favorite album

your urls will end up looking something like this

http://localhost:8080/#/albums/557119

To pull this off your AlbumController will need access to your AlbumService and call the method getAlbumById and pass in the appropriate property from your $stateParams. As long as you built out your service and routes you should be able to attach that album to your AlbumController and start building your view for an individual album.

ng-music's People

Contributors

jakeoverall avatar dustinrpatterson avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.