angular

How to dockerize dotnet core angular template application?

落花浮王杯 提交于 2021-02-19 04:01:27
问题 I created a web application using the dotnet cli angular template. dotnet new anguar Web Now I want to dockerize this application. I added the following Dockerfile to the project folder. FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env WORKDIR /app # Copy csproj and restore as distinct layers COPY *.csproj ./ RUN dotnet restore # Copy everything else and build COPY . ./ RUN dotnet publish -c Release -o out # Build runtime image FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 WORKDIR /app

Angular 2 and fullscreen API

余生颓废 提交于 2021-02-19 03:53:21
问题 I've looked trough the docs and examples, yet found no way to listen for the "onfullscreenchange" event and/or it's variants ("onwebkitfullscreenchange" etc.) on the "document" element. What i've tried without success: /*method 1*/ host: { '(document:onwebkitfullscreenchange)': 'fullScreen()' } /*method 2*/ @HostListener("document:onwebkitfullscreenchange", []) fullScreen() {} /*method 3*/ renderer.listenGlobal('document', 'onwebkitfullscreenchange', (event) => {}) All of the above work with

How open modal from one component into another component in angular?

强颜欢笑 提交于 2021-02-19 03:42:17
问题 i create modal modal component and code my modals in modal.component.html file. i want use this modal in my header.component.html file in header component. related part of my header.component.html is below: <div style="text-align: center"> <a class="social-account-profile icon-plus" (click)="onButtonClick()"</a> </div> onButtonClick is a method in my header.component.ts like below: export class HeaderComponent implements OnInit { constructor(public router: Router, public authService:

Angular how to get the non activated children routes

旧城冷巷雨未停 提交于 2021-02-19 03:38:06
问题 In Angular you can always inject ActivatedRoute in your component to get a reference to the current activated route. It has a property children which: Contains all the child routes activated under the current route. I was wondering how can I get all the children routes (so also the non activated ones). 回答1: You could use route.routeConfig.children to get the children defined in the router. 来源: https://stackoverflow.com/questions/46069944/angular-how-to-get-the-non-activated-children-routes

Angular: add a multi provider from lazy feature module

会有一股神秘感。 提交于 2021-02-19 03:22:42
问题 I have an ErrorModule (eager) configured as follows: export const CONFIG = new InjectionToken<ErrorConfig[]>('Module errors configuration.'); @NgModule({ imports: [... ] }) export class ErrorModule { static forRoot(config: ErrorConfig): ModuleWithProviders { return { ngModule: ErrorModule, providers: [ ErrorService, { provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true }, { provide: CONFIG, useValue: config, multi: true } ] }; } static forChild(config: ErrorConfig):

How to properly serve my Angular application static files from a Django project on Heroku?

99封情书 提交于 2021-02-19 03:08:47
问题 I am trying to deploy on Heroku my app built with Django 2, DRF and Angular 6, and struggling to get the static files of my Angular app served. I am using WhitheNoise for both development environment and on Heroku. The structure of the project is as follows: my_project/ |-frontend/ | |- dist/ | |- ... |-myproject/ | |-settings/ | | |- __init.py | | |- base.py | | |- prod.py | | |- dev.py | |- __init__.py | |- urls.py | |- views.py | |- wsgi.py |-other_app1/ | |- ... |-other_app2/ | |- ... |

Will overwriting my observable variable kill current subscribers?

会有一股神秘感。 提交于 2021-02-19 03:05:55
问题 I want to be able to cache an http call, but also force the cache to refresh. My service looks like this: @Injectable() export class UserService { private currentUser$: Observable<User>; constructor(private http: HttpClient) { } getCurrentUser(force = false): Observable<User> { if (!this.currentUser$ || force) { this.currentUser$ = this.http.get<User>(`${environment.API_URL}/profiles/me`) .pipe( shareReplay(CACHE_SIZE) ); } return this.currentUser$; } } If I call getCurrentUser(true) , the

Angular - Open Bottom Sheet (MatBottomSheet) inside parent container

孤街醉人 提交于 2021-02-19 02:53:41
问题 I'm trying to open a material bottom sheet inside a div container, as default it's opening as the last element inside the body. Looking at the documentation, I need to use the viewContainerRef , but I can't make it work. This is similiar to what I'm trying to do: app.component.html: ... <div #container></div> ... app.component.ts: export class AppComponent implements AfterViewInit { @ViewChild('container', { read: ViewContainerRef }) _container; ... constructor( private bottomSheet:

Angular - Open Bottom Sheet (MatBottomSheet) inside parent container

*爱你&永不变心* 提交于 2021-02-19 02:53:09
问题 I'm trying to open a material bottom sheet inside a div container, as default it's opening as the last element inside the body. Looking at the documentation, I need to use the viewContainerRef , but I can't make it work. This is similiar to what I'm trying to do: app.component.html: ... <div #container></div> ... app.component.ts: export class AppComponent implements AfterViewInit { @ViewChild('container', { read: ViewContainerRef }) _container; ... constructor( private bottomSheet:

How Can I customize mat-form-field in disabled state

核能气质少年 提交于 2021-02-19 02:52:51
问题 I am trying to customize the angular material mat-form-field : I was able to customize the underline border using : ::ng-deep.mat-form-field-ripple { background-color: yellow; } now I am trying to customize the underline border in the disabled state to be solid instead of the dashed line : I tried this but it didn't work for underline : ::ng-deep.mat-form-field-disabled { } I want this to be gray solid in disabled state <mat-form-field> <input matInput placeholder="Input" [disabled]='true'> <