Last active
August 29, 2015 14:15
-
-
Save astemborskim/8b37fb1f919048671b5f to your computer and use it in GitHub Desktop.
MEAN stack with Jade issue - Angular Directives in view not working
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.controller('animalsController', ['$scope', | |
function ($scope){ | |
$scope.test = "This is a test"; | |
$scope.animals = [ | |
{ category : "Cats" }, | |
{ category : "Dogs" }, | |
{ cateogry : "Fish" }, | |
{ category : "Reptiles" }, | |
{ category : "Small Animals" } | |
] | |
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module('myApp', []) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docutype | |
html | |
head(ng-app="myApp") | |
title AniDopt - #{title} | |
body | |
h1 | |
| AniDopt Pet Adoption Services and Community Portal | |
p | |
| Welcome to the AniDopt Adoption Service and Community Portal site. | |
| This online service is intended to assist those looking for pets to | |
| be able to browse availabe animals in need of a good home. You will | |
| also find other community users to discuss various topics about animal | |
| adoption and care. Enjoy! | |
div(ng-controller = "animalsController") | |
ul | |
li {{test}} | |
li(ng-repeat="animal in animals") {{animal.category}} | |
script( src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.13/angular.js") | |
script( text='text/javascript' src="/app.js") | |
script( text="text/javascript" src="/js/controllers/animals-controller.js") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var router = express.Router(); | |
router.get('/', function (req, res) { | |
res.render('index', | |
{title : 'Home'} | |
) | |
}); | |
module.exports = router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
app = express(); | |
//routes defined | |
var routes = require('./client/js/routes/index'); | |
//View engine config | |
app.set('views', __dirname + '/client/views'); | |
app.set('view engine', 'jade'); | |
app.use(express.static(__dirname + '/client/')); | |
//get route | |
app.get('/', routes); | |
//Start server on port 3000 | |
app.listen(3000, function () { | |
console.log("Server is listening..."); | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment