Muhammad

Abid

Technical Lead


How to upgrade NPM on windows

July 28, 2016, Muhammad Abid0 Comments

While I was working on some AngularJs problems, I needed to upgrade node and npm to latest version. As I use Mac personally, it was never been problem as following commands are usually sufficient

powershell


<pre>sudo npm cache clean -f
sudo npm install -g n
sudo n stable

But on windows everything become little tricky. Here comes the google to help. Upgrading is easy if following steps given beneath.
Read More

AngularJS – How to avoid Flicker switching pages

July 25, 2016, Muhammad Abid0 Comments

There are multiple ways to achieve it,

1- Use Resolve in route, $routeProvider resolve property allows delaying of route change until data is loaded.

.config(function ($routeProvider) {
    $routeProvider
      .when('/page2', {
        templateUrl: 'views/page2.html',
        controller: 'Page2Ctrl',
        controllerAs: 'page2', 
        resolve: {
            myData: function($q, $http){ 
                var deferred = $q.defer();

                // USE it to load data and delay page transition.
                return deferred.promise;
            }
        }
      })
      .otherwise({
        redirectTo: '/'
      });
  })

2 – Use ngCloak Use a simple tag to display page loading icon and place ng-cloack after it. ngCloack will hide everything after tag above till page is fully loaded.

<div ng-app="">

<p ng-cloak> // Your normal HTML page</p>

</div>

See this example here.

Installing CA Certificates

February 28, 2016, Muhammad Abid0 Comments

You can list all certificates in the keystore like

on Linux
keytool -list -v -keystore keystore.jks | grep “Alias name\|Creation date”

on Windows
keytool -list -v -keystore keystore.jks | findstr “Alias Creation” Read More