Lets Have a fun with Technology.

BTemplates.com

Follow by Email

Thursday, June 22, 2017

Generate Guid In Angular 2 Application (type Script)


Generate Guid In Angular 2 Application (type Script)


Hello,

Below is code block to generate GUID in angular 2 application.


 function newguidgen() {  
  function id() {  
   return Math.floor((1 + Math.random()) * 0x10000)  
    .toString(16)  
    .substring(1);  
  }  
  return id() + id() + '-' + id() + '-' + id() + '-' +  
   id() + '-' + id() + id() + id();  
 }  

Tuesday, January 24, 2017

Could not load file or assembly 'system.web.http' or one of its dependencies. The located seembly's manifest definition does not match the assemblr reference (Exception from HRESULT : 0x80121040)


Hello,

Sometime we receive below error message.

Could not load file or assembly 'system.web.http' or one of its dependencies. The located seembly's manifest definition does not match the assemblr reference (Exception from HRESULT : 0x80121040)



Solution :-
It will be fix with reinstall of Package.
Run below command in Package manager.


Update-Package Microsoft.AspNet.WebApi -reinstall

Thursday, January 19, 2017

Error in Upgrade of Node.JS


Hello,

Below is command use to upgrade node.js.

npm install npm@latest -g  (Upgrade node.js)

Sometime we get the error in upgrade like



In most of cased the problem with Proxy setting.

To check proxy try to access below url.

https://registry.npmjs.org/

if it works then your proxy is fine else some problem with proxy.


After resetting my proxy it's work fine.



Hope this will helpful..

Enjoy!!!

Friday, September 9, 2016

npm install command fails in Angular2


Hello,

Recently I am working on Angular2 application.

My Client provided application. I have to extend the functionality. I have to run npm install. In my machine I have new environment. I have to run "npm install" command in node.js command prompt. But it's fail every time.

I have double check the version and lots other thing but didn't work.

Then I have run below command which set the registry. And after setting this registry "npm install" works successfully.

Command is

npm set registry https://registry.npmjs.org/


Please don't forgot to comment if this article help you.


Saturday, August 27, 2016

How to Run Angular2 Application in local environment.


Hello,

Below steps need to follow to run Angular2 Application on local machine.

1. First Install node.js from below location.
    https://nodejs.org/en/download/

2. You will see below installed command prompt in your system
    
    



3.  Now we are going to install web server. Run below command in  nodejs command prompt.

    npm install live-server -g

    We will use live-server package. This server written in Node, update the        
    package automatic when changes the source code.

4.  Now we install typescript. Typescript is languae which used to write angular 
     2 application. 

    npm install typescript

5.  I am using Visual studio code as a editor. Install it from below location.
     https://code.visualstudio.com/Download

6. Now you can run your first application. Below is sample application which I         have created. 

     


I know above screen shot is not enough for first example. We will see details code of First Example later. Here I have only shown How to run Angular 2 application.

Let me know if you have query.