Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
angular2でページ読み込み後に処理を実行する方法 ref: http://qiita.com/takuya-andou/items/24f4d5dbd86e102fe231
import {Component, AfterViewInit} from 'angular2/core';
@Component({
selector: 'home',
templateUrl: './components/home/home.html'
})
export class HomeCmp implements AfterViewInit {
ngAfterViewInit() {
//Copy in all the js code from the script.js. Typescript will complain but it works just fine
}
ngAfterViewInit() {
var mVideo = <HTMLVideoElement> document.getElementById('video');
mVideo.addEventListener("ended", function(){
console.log("動画が終了しました"); //ここに要素入れ替えのスクリプトを書く
}, true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.