javascript - jQuery Accordion in AngularJS -
i'd use jquery accordion in angular application. because i'm new angularjs tried define accordion in traditional way , use angular expressions example inside h3 (header) of accordion. didn't work , found lot of posts saying use directive , on. examples seem way complicated...
in app.js there controller , variable:
var app = angular.module('appupdate', []); app.controller("maincontroller", ['$scope', 'http', '$q', function($scope, $http, $q) { $scope.applications = null; ... $scope.init = function() { $scope.initaccordion(); $scope.getapplications(); } $scope.initaccordion = function() { $("#acc").accordion(); } $scope.getapplications = function() { //... } }
this tried inside cshtml:
<body ng-controller="maincontroller"> <div id="acc"> <h3>{{applications.length}} applications found.</h3> <div>content</div> </div> <body>
Comments
Post a Comment