Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
88 lines (56 sloc) 1.43 KB
<!doctype html>
<html lang="en">
<meta charset="UTF-8">
<title>Test Application</title>
<body ng-app="NowPlaying">
<div ng-controller="MyCtrl">
<input type="text" ng-model="username">
<h1>Hello {{username}}</h1>
<h2>My Favorite Libraries</h2>
<li ng-repeat="library in libraries">{{library}}</li>
<button ng-click="doSomething()">Click Me!</button>
<div ng-controller="SecondCtrl">
<li ng-repeat="library in libraries">{{library}}</li>
<script src=""></script>
var app = angular.module('NowPlaying', []);
app.controller('MyCtrl', ['$scope', 'NowPlayingSvc', function($scope, NowPlayingSvc) {
$scope.doSomething = function() {
$scope.username = 'Kyle Buchanan';
/*$scope.libraries = [
* instead of using libraries from the scope, let's
* use the libraries in the service
$scope.libraries = NowPlayingSvc.libraries;
app.controller('SecondCtrl', ['$scope', 'NowPlayingSvc', function($scope, NowPlayingSvc) {
$scope.libraries = NowPlayingSvc.libraries;
app.factory('NowPlayingSvc', [function() {
return {
libraries: [