Когда я нажимаю кнопку, ничего не происходит. Я не получаю никаких ошибок, но это не работает.
Как решить эту проблему?
Демо: https://stackblitz.com/edit/angular-js- ... index.html
Ниже приведен код:
index.html:
Click me for info
{{ title }}
{{ content }}Close
index.js:
import angular from 'angular';
// Create the module first
const app = angular.module('appModule', ['ui.bootstrap']);
// Define the controller on the module
app.controller('TooltipController', [
'$scope',
'$document',
'$timeout',
function ($scope, $document, $timeout) {
$scope.tooltipOpen = false;
$scope.title = 'Important Information';
$scope.content =
'This tooltip appears on click and stays open until closed.';
$scope.toggleTooltip = function ($event) {
$event.stopPropagation();
$event.preventDefault();
$scope.tooltipOpen = !$scope.tooltipOpen;
};
$scope.closeTooltip = function () {
$scope.tooltipOpen = false;
// Apply the change
$scope.$apply();
};
},
]);
Подробнее здесь: https://stackoverflow.com/questions/798 ... -angularjs
Мобильная версия