Showing posts from 2018

Angular run multiple apps in 1 project, Optionality bootstrap components

most posts you'll find talk about actually managing 2 totally different apps under 1 project, and that's best described here: .

but what i really want to achieve is behavior more close to angular 1.x where you could write like 50 directives / components and put just set the ng-app attribute in your Aspx master page and it would just catch whatever is in, so in each page there were 2-10 directives and all was good.

with the angular-cli today its not native possible, but kouasda found a solution, where you test the page for the your angular tags and bootstrap them accordingly, as told in this issue and shown in this plnk.

eventually your app.module should look like this

import {BrowserModule, DOCUMENT} from '@angular/platform-browser'import {NgModule, Inject, ApplicationRef} from '@angular/core'import {AppRootOne} from './app-root-one.component'import {AppRootTwo} from './a…

c# WebRequest error An existing connection was forcibly closed by the remote host

“An error occurred while making the HTTP request to https://<API endpoint>. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.” Inner exception was “Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

this happened to me when doing some HttpWebRequests and suddenly everything stopped working.

apparently the server changed protocol to Tls1.2, and that caused all the mess. PLUS i was using .Net4 so no enum there, so here is the magic line for all you problems

ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;

Sharepoint Rest Api

Working with the SP Rest Api i found some basics that are here to remember.

get by title
var u = "/sites/newportal/_api/Web/lists/getbytitle('Site Pages')/items"

select person field
u += "?$select=Title,Assigned_x0020_To0/Name,FileRef,FileDirRef" +

get folder
var u = "/sites/newportal/_api/Web/GetFolderByServerRelativePath" + 

but to really get a person data by folder in site pages i had to use search

var u = "/_api/search/query?" +
            "querytext='ParentLink:NewEmp'" +