Reputation: 39028
So I'm trying to setup my Angular app example in jsFiddle to get help on another bug, however I'm getting a new bug:
http://jsfiddle.net/leongaban/scx479rw/
Added example in Plunker: http://plnkr.co/edit/yYQHbcatHOu5myL4MXZM?p=preview
I wasn't able to add ng-app="portal"
to the html tag because jsFiddle generates it's own html tag in the output, so I put ng-app
in my first div, could that be the problem?
"Uncaught Error: [$injector:nomod] Module 'portal' is not available!
HTML
<div class="nav"
ng-app="portal"
ng-controller="NavController as nav">
Angular
var app = angular.module('portal');
// Controller for Nav
app.controller('NavController', function() {
....
If it can't find portal because of that issue, how would you setup an Angular app in jsFiddle?
Upvotes: 1
Views: 3837
Reputation: 16498
Please see here http://jsfiddle.net/dvtofn6L/1/
You missed few bits 1:
var app = angular.module('portal', []);
2.
app.controller('SubNavController', function ($scope) {})
https://code.jquery.com/jquery-1.11.1.min.js
Upvotes: 2