Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49337

Adding Javascript to a Controller

$
0
0

@mushy wrote:

How should I add a getelementbyID to a existing controller? Should it be:

.controller('ProductCtrl', function(Products, $scope, $stateParams, $state, $timeout) {
$scope.product = Products[$stateParams.productId];

$scope.$on("$ionicView.loaded", function() {
document.getElementById('myVideo').addEventListener('ended',myHandler,false);
function myHandler(e) {
$state.go('app.home');
}

or perhaps done in another way?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49337


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>