Skip to main content

Posts

Showing posts with the label Angular 2 browsers support

How to load file in your Angular 2 project?

How to load (.d.ts) file in your Angular 2 project? If you are using Angular 2, that time you are using some dependencies like zone. If we adding to “zone” in the apps i.e. import “ angular2 - zone.js / dist - v2 / zone ” ; Noted Point : - You don't change the extension of this file and Just you add the reference of your custom definition inside this file using the triple slash notation i.e. /// <reference path="./your-custom-file-typing.d.ts"> Stayed Informed   -  Angular 2 Interview Questions and Answers I hope you are enjoying with this post! Please share with you friends. Thank you!!

How to use jQuery with Angular 2?

Using  jQuery  with  Angular 2 , if we are using typescript (5, 6 and 7 versions) we should first add jQuery reference definition. Stayed Informed   –   Angular 2 vs. Angular 1 Stayed Informed  –  Best Angular 2 Interview Q/A We can see below line of code to install jQuery i.e. tsd install jquery --save OR typings install dt~jquery --global –save And also we need to add the  ts  reference file. /// <reference path= "../typings/jquery/jquery.d.ts" /> Then make the necessary imports import {bootstrap} from 'angular2/platform/browser'; import {Component, ElementRef, AfterViewInit} from 'angular2/core'; Now, declare jQuery module and the declaring jQuery variable as JQueryStatic will give us a typed reference to jQuery. 1 2 3 4 declare module "jquery" { export = jQuery; } declare var jQuery: JQueryStatic ; In the last, write the class and components 1 2 3 4 5 6 7 8...

Modern browsers are supported in Angular 2?

All the  Angular 2 framework  code is already being written in ECMAScript 6. The set of modern browsers are 1.         Chrome 2.         Firefox 3.         Opera 4.         Safari 5.         IE version10 and 11. On mobiles, it is supporting to the list of Chrome on Android, iOS 6+, Windows Phone 8+ and Fire-Fox mobile and also trying to support to older versions of Android.

AngularJS Print Directive of html templates

Hello everyone, Today's I am going to share an interesting article somebody asked to me in my forum,  Is there an Angular way of printing a div section from a HTML page? I was say to him yes but I don't want how, now I study about it and going to share the detail about the  PRINT to inner  html  templates  using Angular. AngularJs code sample: //This is print method $scope . printTo = function (printSectionId) { var innerContents = document . getElementById (printSectionId).innerHTML; var popupWinindow = window . open ( '' , '_blank' , 'width=600,height=700,scrollbars=no,menubar=no,toolbar=no,location=no,status=no,titlebar=no' ); popupWinindow. document . open (); popupWinindow. document . write ( '<html><head><link rel="stylesheet" type="text/css" href="style.css" /></head><body onload="window.print()">' + innerContents + '</html>' ); popupWi...