mirror of
https://github.com/bitwarden/browser.git
synced 2024-08-26 23:09:46 +02:00
routing to login page
This commit is contained in:
parent
a7994f7ebc
commit
824c5e5ff9
|
@ -5,7 +5,8 @@
|
|||
"dev": "webpack --config webpack.dev.js",
|
||||
"dev:watch": "webpack --config webpack.dev.js --watch",
|
||||
"lint": "tslint src/**/*.ts || true",
|
||||
"lint:fix": "tslint src/**/*.ts --fix"
|
||||
"lint:fix": "tslint src/**/*.ts --fix",
|
||||
"server": "webpack-dev-server --inline --progress --port 8080 --config webpack.dev.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"clean-webpack-plugin": "^0.1.17",
|
||||
|
@ -24,6 +25,7 @@
|
|||
"tslint-loader": "^3.5.3",
|
||||
"typescript": "^2.5.3",
|
||||
"webpack": "^3.8.1",
|
||||
"webpack-dev-server": "^2.11.0",
|
||||
"webpack-merge": "^4.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
3
src/app/accounts/login.component.html
Normal file
3
src/app/accounts/login.component.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<form>
|
||||
Login form.
|
||||
</form>
|
16
src/app/accounts/login.component.ts
Normal file
16
src/app/accounts/login.component.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import * as template from './login.component.html';
|
||||
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
template: template,
|
||||
})
|
||||
export class LoginComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
// TODO?
|
||||
}
|
||||
}
|
18
src/app/app-routing.module.ts
Normal file
18
src/app/app-routing.module.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import {
|
||||
RouterModule,
|
||||
Routes,
|
||||
} from '@angular/router';
|
||||
|
||||
import { LoginComponent } from './accounts/login.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', redirectTo: '/login', pathMatch: 'full' },
|
||||
{ path: 'login', component: LoginComponent },
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forRoot(routes/*, { enableTracing: true }*/)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class AppRoutingModule { }
|
|
@ -1,15 +1,9 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'my-app',
|
||||
styles: [''],
|
||||
template: `
|
||||
<div class="jumbotron text-center">
|
||||
<h1>The App Lives!</h1>
|
||||
<p>{{ message }}</p>
|
||||
</div>
|
||||
`,
|
||||
selector: 'app-root',
|
||||
styles: [],
|
||||
template: 'App<br /><router-outlet></router-outlet>',
|
||||
})
|
||||
export class AppComponent {
|
||||
message = 'This is the sample message.';
|
||||
}
|
||||
|
|
1
src/app/app.d.ts
vendored
Normal file
1
src/app/app.d.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
declare module '*.html';
|
|
@ -1,12 +1,22 @@
|
|||
import 'zone.js/dist/zone';
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { NgModule } from '@angular/core';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { LoginComponent } from './accounts/login.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [BrowserModule],
|
||||
declarations: [AppComponent],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
AppRoutingModule,
|
||||
],
|
||||
declarations: [
|
||||
AppComponent,
|
||||
LoginComponent,
|
||||
],
|
||||
providers: [],
|
||||
bootstrap: [AppComponent],
|
||||
})
|
||||
export class AppModule { }
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>bitwarden</title>
|
||||
<base href="/">
|
||||
</head>
|
||||
<body class="container">
|
||||
<my-app></my-app>
|
||||
<body>
|
||||
<app-root></app-root>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
|
@ -15,8 +15,14 @@ const isVendorModule = (module) => {
|
|||
};
|
||||
|
||||
module.exports = {
|
||||
devServer: {
|
||||
contentBase: './src',
|
||||
historyApiFallback: true,
|
||||
quiet: true,
|
||||
stats: 'minimal'
|
||||
},
|
||||
entry: {
|
||||
'app': './src/app/main.ts'
|
||||
'app': './src/main.ts'
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
|
@ -41,17 +47,17 @@ module.exports = {
|
|||
path.resolve(__dirname, 'build/*')
|
||||
]),
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'app/vendor',
|
||||
name: 'vendor',
|
||||
chunks: ['app'],
|
||||
minChunks: isVendorModule
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
template: './src/index.html',
|
||||
filename: 'index.html',
|
||||
chunks: ['app/vendor', 'app']
|
||||
chunks: ['vendor', 'app']
|
||||
}),
|
||||
new CopyWebpackPlugin([
|
||||
|
||||
|
||||
])
|
||||
],
|
||||
resolve: {
|
||||
|
|
Loading…
Reference in New Issue
Block a user