我对angular非常陌生,并尝试使用yeoman生成器创建一个新的webapp。一切都很好,但后来我尝试添加一条新路线,
CREATE DATABASE IF NOT EXISTS Earnings_Record;
CREATE TABLE IF NOT EXISTS Earnings_Record.Users (
UsersId INT AUTO_INCREMENT PRIMARY KEY,
. . .
);
CREATE TABLE IF NOT EXISTS Earnings_Record.Earnings (
EarningsID INT AUTO_INCREMENT PRIMARY KEY,
UserId INT NOT NULL,
EarningsDate DATE,
Amount DECIMAL(10, 2) -- or whatever
CONSTRAINT fk_Earnings_UserId FOREIGN KEY (UserId) REFERENCES Users(UserId)
) ;
然而,当我尝试访问路线时:
angular
.module('App', [
'ngRoute'
])
.config(function ($routeProvider) {
$routeProvider
.when('/reset', {
templateUrl: 'views/test.html',
controller: 'TestCtrl',
controllerAs: 'test'
})
});
它一直被替换为:
http://localhost:8081/#/reset