API Docs for: 0.3.0
Show:

MeteorExtensions Class

Defined in: lib/mini-pages.js:946

The main Meteor API methods.

Item Index

Attributes

Methods

Meteor.go

(
  • path
  • [state]
)

Navigate to the given path with an optional state object to pass along. This method proxies to the underlying pushState handler. We're currently using page-js.

Parameters:

  • path String

    The path to navigate to. Example: "/posts/1234".

  • [state] Object optional

    An optional state object.

Example:

Meteor.go(Meteor.postShowPath({_id: 1234}), { flash: "" });

Meteor.pages

(
  • pages
  • [options]
)
PageRouter

Convenience method to create a new PageRouter instance and call the pages method on it to create a bunch of pages at once.

Parameters:

  • pages Object

    An object of paths to page options.

  • [options] Object optional

    Optional options to pass to the PageRouter constructor

Returns:

PageRouter: A new PageRouter instance.

Example:

Meteor.pages({
 "/posts": "postIndex",

 "/posts/:_id": {
    to: "templateName",
    layout: "layoutName",
    nav: "nav key",
    before: [ before callbacks ],
    as: "path helpers name"
 },

 logout: function () {
 }
}, {
  // optional options to pass to PageRouter constructor.
  autoRender: false
});

Attributes

Meteor.PageRouter

The PageRouter class.