So, at this point, our todo application has some interesting features, but it's very bare bones. It's also literally a single page application, but, of course, real applications typically involve multiple pages. Let's extend ours to have multiple pages.
We've already included bidi
as a dependency of the application, and we've already used it on the server side. Now, we will use it to do client-side routing. Here, routing refers to the process of determining which page to display, based on the contents of the URL. Let's get started.
First, we'll modify project.clj
and add [venantius/accountant "0.1.7"]
to the :dependencies
vector. Then, let's add [accountant.core :as accountant]
to the om-tut.core ns
declaration:
(ns om-tut.core (:require [accountant.core :as accountant] [ajax.core :as ajax] [bidi.bidi :as bidi] [om.core :as om :include-macros true] [om.dom :as dom :include-macros true...