Struggling with getting the router to load a basic template after setting up a Yeoman angular scaffolder installation. Here's my configuration:
// index.html
<body ng-app="mvmdApp">
<div class="container" ng-view=""></div>// not sure how ng-view plays into this
// app.coffee
myAppModule = angular.module("mvmdApp", [])
.config( ($routeProvider, $locationProvider) ->
$locationProvider.html5Mode true
$routeProvider
.when("/",
templateUrl: "views/main.html"
controller: "MainCtrl"
)
.when("/youtube",
templateUrl: "views/youtube.html"
controller: "YoutubeCtrl"
)
)
// main.js
angular.module('mvmdApp')
.controller 'MainCtrl', ($scope) ->
$scope.awesomeThingss = [
'HTML5 Boilerplate'
'AngularJS'
'Karma'
]
$scope.youtube = ( $scope ) ->
alert 'hi'
.controller "YoutubeCtrl", ( $scope ) ->
alert 'Work!'
// views/youtube.html
<div class="youtube-unit">
<div class="outer-frame">
<div class="inner-frame">
<iframe width="560" height="315" src="//www.youtube.com/embed/2FNEiTjcMM0" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
</div>
</div>
</div>
The main controller is loading successfully. I have tried duplicating it as much as possible.
When trying to access localhost:9000/youtube, I receive a Cannot GET /youtube
message. I've experimented with various combinations but can't seem to get it working.