Created
August 14, 2017 21:07
-
-
Save SwarnaKishore/2e9d24a08aa294ab1a2f819c96dc0137 to your computer and use it in GitHub Desktop.
using-jquery-in-angular
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import * as $ from 'jquery'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css'] | |
}) | |
export class AppComponent implements OnInit { | |
title = 'Look jQuery Animation working in action!'; | |
public ngOnInit() | |
{ | |
$(document).ready(function(){ | |
$("button").click(function(){ | |
var div = $("div"); | |
div.animate({left: '100px'}, "slow"); | |
div.animate({fontSize: '5em'}, "slow"); | |
}); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can replace:
import * as $ from 'jquery';
with
declare var $: any;
and get the same functionality