抱歉我不擅长英语,请理解主题不好。
我正在创建一个带有angular.js的SPA。
我想使用ng-route按路径更改或追加视图。
例如,
1
SELECT
p.*
FROM product p
ORDER BY p.id desc NULLS LAST OFFSET $1 LIMIT $2
2
SELECT
p.*
FROM product p
WHERE p.id < $1
ORDER BY p.id desc NULLS LAST LIMIT $2
1
SELECT
p.*
FROM product p
ORDER BY p.name desc NULLS LAST OFFSET $1 LIMIT $2
2
SELECT
p.*
FROM product p
AND p.price_number < $1
ORDER BY p.name desc NULLS LAST LIMIT $2
CREATE TABLE IF NOT EXISTS "product"(
"id" SERIAL NOT NULL,
"name" varchar DEFAULT NULL,
"name_slug" varchar DEFAULT NULL,
"price_number" numeric DEFAULT NULL,
PRIMARY KEY ("id")
);
当选择顶部菜单,然后leftMenu shuld被更改。
然后我访问<div id="topMenu" ng-controller="MainMenuController as mainMenuCtrl">
<a href="#/menu1" ng-show="menuSelected('menu1')">menu1</a>
<a href="#/menu2" ng-show="menuSelected('menu2')">menu2</a></div>
<div>
<div id="leftMenu"><!-- Sub menus for each main menu. path= #/(menu1|menu2) --></div>
<div id="content"><!-- Contents for each submenus path= #/(menu1|menu2)/{someSubMenu}/{contentName}--></div>
然后leftMenu的链接,并且应该更改内容。
我需要做什么来实施这些过程?