Skip to content

Commit 04bfa8e

Browse files
committedOct 19, 2015
Added not found template
chapter5-4
1 parent 7b9264d commit 04bfa8e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<template name="notFound">
2+
<div class="not-found page jumbotron">
3+
<h2>404</h2>
4+
<p>Sorry, we couldn't find a page at this address.</p>
5+
</div>
6+
</template>

‎lib/router.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Router.configure({
22
layoutTemplate: 'layout',
33
loadingTemplate: 'loading',
4+
notFoundTemplate: 'notFound',
45
waitOn: function() { return Meteor.subscribe('posts'); }
56
});
67

@@ -10,3 +11,5 @@ Router.route('/posts/:_id', {
1011
name: 'postPage',
1112
data: function() { return Posts.findOne(this.params._id); }
1213
});
14+
15+
Router.onBeforeAction('dataNotFound', {only: 'postPage'});

0 commit comments

Comments
 (0)