我有一个关于角js的问题。
我尝试打开对话框使用$旁边但我得到注入错误我尝试此代码我尝试在安装bower install angular-aside
后使用ngAsige,但我得到错误像Failed to instantiate module IndexHome due to:
如果我的代码中的任何错误请告诉我它在哪里,安装后angular-aside
是我必须包含在我的.html文件中的任何.js文件?
var Myapp = angular.module('IndexHome', ['ngRoute','ui.bootstrap', 'ngAside']);
Myapp.controller('home', function ($scope, $window, $http,$aside) {
var ServiceForm = $aside({
scope: $scope,
templateUrl: '/tpl/index/home/popup.html',
show: false,
placement: 'left',
backdrop: false,
animation: 'am-slide-left'
});
$scope.Bookservice=function(item)
{
ServiceForm.show();
}
});
答案 0 :(得分:2)
与任何其他角度模块/依赖项一样,为了能够使用Angular Aside,请确保包含angular-aside.js(以及 angular-aside.css )并注入它在哪里你想用它:
angular.module('myApp', ['ui.bootstrap', 'ngAside']);
angular.module('myApp')
.controller('MyController', function($scope, $aside) { });
答案 1 :(得分:1)
您需要将angular-aside.js
和angular-aside.css
(或其缩小版本)包含在index.html中。