I am facing an issue with the Opentoke Library directive, particularly when I use the ng-if
. The reason for implementing the ng-if
is that WebRTC is not supported on IOS devices, so it displays an alert after the DOM has loaded.
<div class="opentok" ng-if="!isMobileView">
<open-tok-archive></open-tok-archive>
</div>
<a href="javascript:void();" ng-click="myMethod()">click me</a>
<div class="opentok" ng-if="!isMobileView">
<open-toke-screen-share></open-toke-screen-share>
</div>
Everything works fine without using ng-if
.
Directive
'use strict';
var session, apiKey, publisher, openTokToken, archiveID;
angular.module('app')
.directive('openTokArchiv', [function () {
return {
restrict: 'EA',
templateUrl: 'views/pages/openTokArchive.html',
controller: function (OpenTokService, OTSession, $window, $rootScope, $scope, $routeParams, $cookieStore) {
$scope.myMethod = function (){
console.log("---------not-- working ---------")
}
};
}]);