This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3>Data coming from server values API</h3> | |
<ul> | |
<li *ngFor="let value of values"> | |
{{ value }} | |
</li> | |
</ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { HttpClientModule } from '@angular/common/http'; | |
import { AppComponent } from './app.component'; | |
@NgModule({ | |
declarations: [ | |
AppComponent | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { HttpClient } from '@angular/common/http'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css'] | |
}) | |
export class AppComponent { | |
title = 'app'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.UseStaticFiles(); | |
app.UseSpaStaticFiles(); | |
app.UseMvc(routes => | |
{ | |
routes.MapRoute(name: "default", template: "{controller}/{action=index}/{id}"); | |
}); | |
app.UseSpa(spa => | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); | |
services.AddSpaStaticFiles(c => | |
{ | |
c.RootPath = "ClientApp/dist"; | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IList<string> templates = new List<string>(); | |
var blog = GetBlogs().SingleOrDefault(b => b.Id == blogId); | |
if (blog != null) | |
{ | |
foreach (var fileProvider in _viewEngineOptions.FileProviders) | |
{ | |
var files = fileProvider.GetDirectoryContents($"/Views/Themes/{blog.Theme}/Templates"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Naif.Blog.ViewModels; | |
@model BlogViewModel | |
@{ | |
if(!string.IsNullOrEmpty(Model.Page.PageTemplate)) | |
{ | |
Layout = $"~/Views/Themes/{Model.Blog.Theme}/Templates/{Model.Page.PageTemplate}.cshtml"; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{ | |
Layout = "_Layout"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{ | |
var user = new UserProfile | |
{ | |
Name = User.Identity.Name, | |
EmailAddress = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Email)?.Value, | |
ProfileImage = User.Claims.FirstOrDefault(c => c.Type == "picture")?.Value | |
}; | |
} | |
<section> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override void Process(TagHelperContext context, TagHelperOutput output) | |
{ | |
string content = @"<div class='col-md-2'>"; | |
if (string.IsNullOrEmpty(Image)) | |
{ | |
content += $@"<img src='{Image}' alt='' class='img-rounded img-responsive' />"; | |
} | |
content += @"</div>"; |
NewerOlder