Ana içeriğe atla

Kayıtlar

Angular uygulama içinde birden fazla layout kullanımı

Angular uygulamamız içerisinde login/logout sayfalarında farklı layout, uygulama içinde farklı layout, hatta farklı bölümler için de birden fazla layout kullanmak isteyebiliriz. Bu durumlar için yapmamız gereken işlem her bir layout'umuz için farklı bir component oluşturmak ve Route dosyamızı aşağıdaki şekilde güncellememiz yeterlidir. Şimdi diyelim ki 2 adet layout kullanacağız. Layotlarımızdan biri sadece bir layout olsun adına BasicLayoutComponent , diğeri de genel olarak projemizde kullanacağımız bir layout olsun header footer bilgileri içersin. Bu layoutumuzun adına da PortalLayoutComponent diyelim. Layoutları da kullanan login ve index adında iki component oluşturalım. Componentleri aşağıdaki komut satırı ile oluşturabiliriz.  - ng generate component BasicLayout  - ng generate component PortalLayout  - ng generate component Index  - ng generate component Login Ardından app-routing.module.ts dosyamızı aşağıdaki şekilde düzenliyelim. app-routing.m...

How to import bootstrap and jquery to our angular project

In order to import jquery and bootstrap frameworks to our angular project. we may use following command via commandline. Update angular cli  - npm install -g @angular/cli Import jquery and bootstrap  - npm install bootstrap jquery If the commands above gave you to permission you can open commandline as right click "Run as Administrator" on windows, add prefix "sudo " in mac After run commands, then the add paths of jquery and bootstrap as follows in to angular.json file which is located in root of project. "styles": [               "src/styles.css",               "node_modules/bootstrap/dist/css/bootstrap.min.css"             ],             "scripts": [               "node_modules/jquery/dist/jquery.min.js",               "node_modules/bootstrap/dist/j...

Asp.Net Web Api - Windows Authentication

Asp.Net Web Api projemize internal çalışacak bir güvenlik sistemi eklemek için Windows Authentication eklemek isteyebiliriz. Bunun için internette biraz nitelikli kaynak sıkıntısı çektiğim için ihtiyacı olanlara yardımcı olması açısından bilgi vermek istiyorum. Öncelikle bu işlem oldukça basit bir süreç. Sırası ile aşağıdaki aşamaları uygulamamız yeterli olacaktır. 1. web.config dosyasını açıp <system.web> in altına aşağıdaki ayarı ekliyoruz.   <authentication mode="Windows">     </authentication> 2. Windows Authentication özelliğini kullanmak istediğimiz api metodlarımızın üzerine [Authorize] annotation ununu eklememiz ilgili aip metodlarımızın Windows Authentication ile çalışması için yeterli. 3.Gelelim Http Client tarafında test edip çalıştırma işlemine. aşağıdaki kod bloğu ile api metodlarımızı çağırabilir ve windows auth bilgilerini HttpClientHandler ile sağlayabiliriz. var httpClient = new HttpClient(new HttpClientHandler() ...

Sql Check All Tables Data Size

When the sql server has large data size then we need to check which table has how much data row and data size. TO check all tables data size and row count in sql server we may use following sql query: SELECT     t.NAME AS TableName,     s.Name AS SchemaName,     p.rows AS RowCounts,     SUM(a.total_pages) * 8 AS TotalSpaceKB,     CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalSpaceMB,     SUM(a.used_pages) * 8 AS UsedSpaceKB,     CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS UsedSpaceMB,     (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB,     CAST(ROUND(((SUM(a.total_pages) - SUM(a.used_pages)) * 8) / 1024.00, 2) AS NUMERIC(36, 2)) AS UnusedSpaceMB FROM     sys.tables t INNER JOIN        sys.indexes i ON t.OBJECT_ID = i.object_id INNER JOIN     sys.partitions p ON i.ob...

Installing dotnet core 2.2 version with ssh terminal

To check your dotnet core current version on your linux machine with terminal ssh connection type following command to terminal  dotnet --info Above commanve will give you detail explanation about your dotnet core version.To install 2.2 or any spesific version of dotnet core type following kind of command to your terminal then complete your dotnet core 2.2 version installation. sudo yum install dotnet-sdk-2.2

Sql Server Database Language Change

-- Set to single-user mode ALTER DATABASE   yourdatabasename SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO    -- change collation ALTER DATABASE  yourdatabasename    COLLATE Turkish_CI_AS ;   GO   -- Set to multi-user mode ALTER DATABASE yourdatabasename SET MULTI_USER WITH ROLLBACK IMMEDIATE ; GO   --Verify the collation setting.   SELECT name , collation_name   FROM sys . databases   WHERE name = yourdatabasename' ;  

Angular Routing Problem on Linux Host

If your angular application working well on localhost then does not work on linux host when redirecting any of existing page with returning 404 error. It means that you have missing routing configuration for routing. To provide right configuration on linux apache server just put following code to .htAccess file of your angular application root folder and check the the magic :) .htaccess file content should be as following: RewriteEngine On # If an existing asset or directory is requested go to it as it is RewriteCond %{ DOCUMENT_ROOT }%{ REQUEST_URI } - f [ OR ] RewriteCond %{ DOCUMENT_ROOT }%{ REQUEST_URI } - d RewriteRule ^ - [ L ] # If the requested resource doesn't exist, use index.html RewriteRule ^ / index . html On the otherhand, If you deployed your app to another servers check the following solutions : IIS Server on windows host , following webconfig rule can be help you to solve your redirection problem web.config file con...