The elements of type date allows user to enter date, using a text box or using date picker. With the ng-model directive, bins the values of AngularJS application data to HTML input controls. Firefox does not currently support type="date". It will convert all the values to string. Sinceyou want date to be a real Date object and not a string, so we create another variable, and then link the two variables as done in the below given code function MainCtrl($scope, dateFilter) { $scope.date = new Date(); $scope.$watch('date', function (date){ $scope.dateString = dateFilter(date, 'yyyy-MM-dd'); ... Read More
Html2Canvas is a JavaScript library that can take screenshot of the whole web page or specific part. It doesn’t take the screenshot but creates the view based on the page information.ExampleBelow given is an example code. Here, html2canvas.js script is included at the . The html2canvas() method is called. Returns the base64 value, which eventually creates image source or an image file. Take screenshot function screenshot(){ html2canvas(document.body).then(function(canvas) { document.body.appendChild(canvas); }); }
For double buffering on the canvas, create a 2nd canvas element and draw to it. After that draw the image to the first canvas using the drawImage() method,// canvas element var canvas1 = document.getElementById('canvas'); var context1 = canvas1.getContext('2d'); // buffer canvas var canvas2 = document.createElement('canvas'); canvas2.width = 250; canvas2.height =250; var context2 = canvas2.getContext('2d'); // create on the canvas context2.beginPath(); context2.moveTo(10,10); context2.lineTo(10,30); context2.stroke(); //render the buffered canvas context1.drawImage(canvas2, 0, 0);
In the first example, you are just inheriting amitBaseClass prototype.function SomeClass() { } SomeClass.prototype = Object.create(amitBaseClass.prototype);In the second example, you are executing the constructor function. An instance of amitBaseClass is created and you are inheriting the who complete amitBaseClass object.function SomeClass () { } SomeClass.prototype = new amitBaseClass ();So, both are doing separate work.
To disable web browsers’ back button, try to run the following code. This is the code for current HTML page,Example Disable Browser Back Button Next Page $(document).ready(function() { function disablePrev() { window.history.forward() } window.onload = disablePrev(); window.onpageshow = function(evt) { if (evt.persisted) disableBack() } }); The following is the code for newpage.html, Go to back page using web browser back button. a
Automation is one of the hot domain in the Information and Technology, which has become predominant topic of discussion among the IT professionals. In general, automation can be defined as the process of involving software robots or hardware robots to solve the human problems (requirements). Due to this automation, it is said that ¼th of the job will be lost in the market. But people still prefer automation for (top) 7 reasons, which is discussed in this article.Cost SavingsCost is one of the major factor in the software development cycle, which predominantly comes into picture right from the planning phase. ... Read More
Fully self-driving cars may soon be a reality with Tesla cars. But Tesla still has a long way to completely set its autopilot suite of self-governing technologies in place. Autonomous driving refers to driving cars without the need of any human involvement. As of now, Tesla cars are semi-autonomous i.e. features that assist drivers on highways.The Tesla Autopilot SystemThe Tesla autopilot is a semi-autonomous system. It was rolled out in October 2014 in Tesla Model S cars. But it was only in 2015, that the Tesla Autopilot system (Tesla Version 7.0) rolled out. It allowed the car to adjust its ... Read More
In this article, we will learn and discuss some important performance tuning settings for MySQL which we need to implement after the MySQL Installation better and speedy performance.Pre-requisitesAssuming that we have already installed the MySQL, I am providing some tips before we start to know about Performance tuning settings for MySQL.Even experienced IT persons may make some mistakes which will lead to many problems, so before we apply any recommendations which are shown in this article, we will keep the below items in mind to avoid issues or problems.We will apply only one setting at a time so that we ... Read More
Instead of shopping for an expensive smart TV, you’ll be able to convert your existing TV into a web-enabled entertainment center by just spending a few thousands of rupees. With this, you’ll have access to everything the Web, the PC and the Google Play store have to offer.Here are some helpful gadgets which will facilitate your recent TV work like a smart TV –Portable Media PlayersIf you’re working on a tight budget, you might want to consider an ultra-portable media player. These thumb-sized sticks, which resemble USB pen drives, are capable of streaming content – pictures, music, videos – wirelessly ... Read More
Exams! Are they around the corner? They rob many of their very youthful glows. All those who face exams know that the struggle is real. Many fear the fret of getting weeded out. And many more find themselves trapped in the ‘end-of-the-semester jam’.Are you anxious? Do you feel like being at your breaking point? What would be my life if I get B grade? Is that what you are thinking and getting depressed?Oh please, just move one step back, take a deep breath and blow it out slowly. Exams anxiety is a real but silly thing. Relax and relieve your ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP