fix update mistakes
This commit is contained in:
parent
620a3dfe51
commit
50833cc8f9
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "Company.WebApplication1",
|
"name": "company.webapplication1",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,11 @@ import { NavMenuComponent } from './nav-menu/nav-menu.component';
|
||||||
import { HomeComponent } from './home/home.component';
|
import { HomeComponent } from './home/home.component';
|
||||||
import { CounterComponent } from './counter/counter.component';
|
import { CounterComponent } from './counter/counter.component';
|
||||||
import { FetchDataComponent } from './fetch-data/fetch-data.component';
|
import { FetchDataComponent } from './fetch-data/fetch-data.component';
|
||||||
|
////#if (IndividualLocalAuth)
|
||||||
|
import { ApiAuthorizationModule } from 'src/api-authorization/api-authorization.module';
|
||||||
|
import { AuthorizeGuard } from 'src/api-authorization/authorize.guard';
|
||||||
|
import { AuthorizeInterceptor } from 'src/api-authorization/authorize.interceptor';
|
||||||
|
////#endif
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
|
|
@ -22,13 +27,26 @@ import { FetchDataComponent } from './fetch-data/fetch-data.component';
|
||||||
BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }),
|
BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }),
|
||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
|
////#if (IndividualLocalAuth)
|
||||||
|
ApiAuthorizationModule,
|
||||||
|
////#endif
|
||||||
RouterModule.forRoot([
|
RouterModule.forRoot([
|
||||||
{ path: '', component: HomeComponent, pathMatch: 'full' },
|
{ path: '', component: HomeComponent, pathMatch: 'full' },
|
||||||
{ path: 'counter', component: CounterComponent },
|
{ path: 'counter', component: CounterComponent },
|
||||||
|
////#if (IndividualLocalAuth)
|
||||||
|
{ path: 'fetch-data', component: FetchDataComponent, canActivate: [AuthorizeGuard] },
|
||||||
|
////#else
|
||||||
{ path: 'fetch-data', component: FetchDataComponent },
|
{ path: 'fetch-data', component: FetchDataComponent },
|
||||||
|
////#endif
|
||||||
])
|
])
|
||||||
],
|
],
|
||||||
|
////#if (IndividualLocalAuth)
|
||||||
|
providers: [
|
||||||
|
{ provide: HTTP_INTERCEPTORS, useClass: AuthorizeInterceptor, multi: true }
|
||||||
|
],
|
||||||
|
////#else
|
||||||
providers: [],
|
providers: [],
|
||||||
|
////#endif
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent]
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule { }
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,22 @@
|
||||||
import { Component, Inject } from '@angular/core';
|
import { Component, Inject } from "@angular/core";
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from "@angular/common/http";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-fetch-data',
|
selector: "app-fetch-data",
|
||||||
templateUrl: './fetch-data.component.html'
|
templateUrl: "./fetch-data.component.html"
|
||||||
})
|
})
|
||||||
export class FetchDataComponent {
|
export class FetchDataComponent {
|
||||||
public forecasts: WeatherForecast[];
|
public forecasts: WeatherForecast[];
|
||||||
|
|
||||||
constructor(http: HttpClient, @Inject('BASE_URL') baseUrl: string) {
|
constructor(http: HttpClient, @Inject("BASE_URL") baseUrl: string) {
|
||||||
http.get<WeatherForecast[]>(baseUrl + 'api/Company.WebApplication1Data/WeatherForecasts').subscribe(result => {
|
http
|
||||||
this.forecasts = result;
|
.get<WeatherForecast[]>(baseUrl + "api/SampleData/WeatherForecasts")
|
||||||
}, error => console.error(error));
|
.subscribe(
|
||||||
|
result => {
|
||||||
|
this.forecasts = result;
|
||||||
|
},
|
||||||
|
error => console.error(error)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,9 @@
|
||||||
class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse"
|
class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse"
|
||||||
[ngClass]="{ show: isExpanded }"
|
[ngClass]="{ show: isExpanded }"
|
||||||
>
|
>
|
||||||
|
<!--#if (IndividualLocalAuth) -->
|
||||||
|
<app-login-menu></app-login-menu>
|
||||||
|
<!--#endif -->
|
||||||
<ul class="navbar-nav flex-grow">
|
<ul class="navbar-nav flex-grow">
|
||||||
<li
|
<li
|
||||||
class="nav-item"
|
class="nav-item"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue