문제

// main.html

<template name="layout">
    {{yield}}
</template>

<template name="notFound">
    notFound
</template>

// router.js

Router.configure({
    layoutTemplate: "layout",
    loadingTemplate: "loading",
    notFoundtemplate: "notFound"
});

Router.map(function() {

    this.route('home', {
        path: '/'
    });

});

"http://hedcet.com:3000/" working perfectly

but

when i try "http://hedcet.com:3000/x" (route /x) which is not defined in router.js, it shows an error in console & not show notFound template

// console error

Uncaught Error: Oh no! No route found for path: "/x"

could u suggest any solution ? i want to show notFound template if any try a non existing path in meteor

도움이 되었습니까?

해결책

You got a 't' that should be a 'T' in notFoundtemplate.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top