我正在使用我的上下滑动效果这个天才写的.js模块。 https://github.com/EricWVGG/AngularSlideables
我可以把它包含在我的项目中,它按照我想要的方式工作。 但是现在我想在我的控制器中触发这个,我该怎么做?
HTML
<a href="" ng-click="Triggerhere();" slide-toggle="#derp">Open smoothly</a>
<div id="derp" class="slideable">
open/hidden content
</div>
的.js
var myApp = angular.module('myApp', ['ngAnimate', 'angularSlideables']);
angular.module('angularSlideables', [])
.directive('slideable', function () {
return {
all the code from the github
})
myApp.controller("ContactControllerHeading", function ($scope, $http) {
$scope.Triggerhere= function() {
/* trigger here this slide-toggle="#derp" */
}
});
非常感谢
答案 0 :(得分:0)
我放弃了解决它。我使用jquery上下滑动功能,这似乎是一个充分的解决方案