Connect TFS to visual studio code

Hello Friend’s,

Visual studio code is very important tool when working with angular 2 and other languages.


Most of times TFS is used for source control. We need to do some setting for that.


Below settings are needs to done.


1. Open the Setting in visual studio code as shown in below screen shot.





    2. Below Codes are needed to do in settings.
        


{
"tfvc.location": "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\tf.exe",
"tfvc.restrictWorkspace": true
}


After this you will receive below error.

(team) You are not connected to a Team Foundation Server. Please run the 'team signin' command.


Now run Sign in command. Or you may click on below icon.


Enter your TFS user name and password. After login in you are successfully connect to TFS.

Now you can see your changes at Source Control menu.



Posted in | 0 comments

Visual Studio code does not show extension List. Proxy Issue

Hello Friend’s,

It's always hard time when working with Visual studio code and Git repository behind the proxy. Don't know for others but for me yes.

Some time you might face problem to access extension in visual studio code if you are behind proxy. Below is way to handle it.


1.  Open the Setting in visual studio code as shown in below screen shot.




2. 2. Enter the Setting as shown below. These are setting for Http and Https Proxy. 

    


 // Place your settings in this file to overwrite the default settings
 {
 "http.proxy":"proxy name",
 "https.proxy":"proxyname",
 "http.proxyStrictSSL": false
 }






Hope it will work. 

If still not working then one more setting need to do. 

Please note I have done this setting to access bit bucket repository from proxy behind. Open you user folder. (C-> Users -> Your user name) Make note pad file with extension .npmrc Add below setting in that files.



registry=https://registry.npmjs.org/
http-blrproxy.igate.com=YOUR PROXY
https-blrproxy.igate.com=YOUR PROXY
proxy=http://DOMAIN%USERNAME:PASSWORD@PROXY/
strict-ssl=false 
Replace PROXY with your company proxy.
Replace DOMAIN,USERNAME and PASSWORD with current values.



Posted in | 0 comments

Add Read More note with web site link When Someone Copies Text from your website.

Hello,

Below code use full when you want to add your link when some one copy from your website.


Put below java script code in main Master page.




function addLink() {
    //Get the selected text and append the extra info
    var selection = window.getSelection();
    pagelink = ". Read more at: " + document.location.href;
    copytext = selection + pagelink;
 //Create a new div to hold the prepared text
    newdiv = document.createElement('div');

    //hide the newly created container
    newdiv.style.position = 'absolute';
    newdiv.style.left = '-99999px';

    //insert the container, fill it with the extended text, and define the new selection
    document.body.appendChild(newdiv);
    newdiv.innerHTML = copytext;
    selection.selectAllChildren(newdiv);

    window.setTimeout(function () {
        document.body.removeChild(newdiv);
    }, 100);
}
document.addEventListener('copy', addLink);



Hope this will help.

Posted in | 0 comments

Format JSON Date.

Hello,

Below is way to format JSON Date.

var date = new Date(parseInt(jsonDate.substr(6)));

The substr function takes out the "/Date(" part, and the parseInt function gets the integer and ignores the ")/" at the end. The resulting number is passed into the Date constructor.

if you are using newtonsoft then see at below location.
https://www.newtonsoft.com/json

Posted in | 0 comments

How to bind Event on dynamically created elements in JQuery.


We can achieve this using jQuery.fn.on.  
(Details document available at https://api.jquery.com/on/#on-events-selector-data-handler)

Let’s have an example.

Suppose your page creating element with the class name 'Applyevent'
you would bind the event to a parent which already exists
mainly 'document'




$(document).on('mouseover', '.Applyevent', function(){

    // what you want to happen when mouseover 

    // occurs on elements that match '.Applyevent'

});



Any parent that exists at the time the event is bound is fine. For example






$('.dynamicgenerate').on('click', 'button', function(){

    // code here

});







<div class="dynamicgenerate">

     

              <---- Dynamic Controls here ---->

              --- Suppose <button>


</div>

Posted in Labels: | 0 comments