Академический Документы
Профессиональный Документы
Культура Документы
Achref El Mouelhi
elmouelhi.achref@gmail.com
1 Bootstrap
2 jQuery
Bootstrap
3 étapes à suivre :
Installation
Intégration
Utilisation
Bootstrap
Installation
npm install --save bootstrap
Vérifier qu’un répertoire bootstrap a bien été créé dans
node modules
Bootstrap
Bootstrap
<ul class="list-group">
</ul>
Bootstrap
jQuery
4 étapes à suivre :
Installation
Intégration
Déclaration
Utilisation
jQuery
Installation
npm install --save jquery
Ouvrir le fichier .angular-cli.json (ou .angular.json pour
Angular 6) situé à la racine de votre projet
jQuery
jQuery
@Component({
selector: ’my-root’,
templateUrl: ’./my.component.html’,
styleUrls: [’./my.component.css’]
})
jQuery
Maintenant, on peut utiliser jQuery dans les *.component.ts :
exemple
import { Component, OnInit } from ’@angular/core’;
declare var $: any;
@Component({
selector: ’my-root’,
templateUrl: ’./my.component.html’,
styleUrls: [’./my.component.css’]
})
export class MyComponent implements OnInit {{
ngOnInit() {
$(’#test’).click(function() {
alert(’ test jquery ’);
});
}
}
08 février 2018, POEC JS Full Stack 12 / 13
jQuery
jQuery
Dans le *.component.html
<button id ="test">jQuery</button>
jQuery
Dans le *.component.html
<button id ="test">jQuery</button>
Pour tester
En cliquant sur le bouton jQuery, un message d’alert JS sera affiché
avec comme contenu test jquery