Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
angular2でページ読み込み後に処理を実行する方法 ref:
import {Component, AfterViewInit} from 'angular2/core';
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.