We're trying to get JqueryUI menus to work in our AngularJS app. From our Layout.js we're doing the following:
OURApp.controller('leftBarCtrl', ['$scope', function ($scope) {
$scope.init = function () {
$.ajax({
url: "../Data/MainPageData",
type: "GET",
dataType: "Json",
data: {},
success: function (data) {
if (data.Acknowledgment) {
$scope.$apply(function () {
$scope.subscriptionsModel = data.userSubscriptionsReponse.UserSubscriptionsObjects;
$scope.CompanyModel = data.userResponse.CompanyInformation;
})
$("#mdsubscriptionMenu").menu({
menus: "ul",
items: "li"
});
}
.......
But it doesn't seem to work. I read that moving the menu() call to an angular ".directive" restricted to 'A' should do the trick. Is that the only recommended way of getting JqueryUI components to work with AngularJS?
Thanks
$httpinstead of$.ajaxwill remove your worry to rundigestcycle