Skip to content

Instantly share code, notes, and snippets.

@SwarnaKishore
Created August 14, 2017 21:07
Show Gist options
  • Save SwarnaKishore/2e9d24a08aa294ab1a2f819c96dc0137 to your computer and use it in GitHub Desktop.
Save SwarnaKishore/2e9d24a08aa294ab1a2f819c96dc0137 to your computer and use it in GitHub Desktop.
using-jquery-in-angular
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");
});
});
}
}
@dariusve
Copy link

you can replace:
import * as $ from 'jquery';
with
declare var $: any;
and get the same functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment