ngAnimate 및 ui-view를 사용할 때 오류가 발생합니다. 어떤 내비게이션 메뉴를로드하거나 클릭하십시오; angular-animate.js는 'object is not function'오류를 생성합니다. 여기ngAnimate 객체가 함수로 설정되지 않았습니다.
주요 javacsript 응용 프로그램 :
(function() {
'use strict';
var app = angular.module("pie", ['ui.router', 'uiGmapgoogle-maps', 'ui.bootstrap', 'ngAnimate']);
app.config(["$stateProvider", "$locationProvider", "$urlRouterProvider",
function ($stateProvider, $locationProvider, $urlRouterProvider) {
$locationProvider.html5Mode({ enabled: true, requireBase: false });
$urlRouterProvider.otherwise('/Welcome');
$stateProvider
.state("Welcome", {
url: "/Welcome",
templateUrl: "../Scripts/Home/WelcomeView.html",
controller: "WelcomeController"
})
.state("About", {
url: "/About",
templateUrl: "../Scripts/Home/AboutView.html",
controller: "AboutController"
})
.state("Contact", {
url: "/Contact",
templateUrl: "../Scripts/Home/ContactView.html",
controller: "ContactController"
})
.state("Login", {
url: "/Account/Login"
})
.state("Register", {
url: "/Account/Register"
})
.state("ForgotPassword", {
url: "/Account/ForgotPassword"
});
}]);
//app.animation('.view-animation', function() {
// return {
// enter: function (element, done) {
// element.css({
// opacity: 0.5,
// position: "relative",
// top: "10px",
// left: "20px"
// }).animate({
// top: 0,
// left: 0,
// opacity: 1
// }, 1000, done);
// }
// };
//});
app.config(['$httpProvider', function ($httpProvider) {
//Http Intercpetor to check auth failures for xhr requests
$httpProvider.interceptors.push('AuthHttpResponseInterceptor');
}]);
// Google map
app.config(['uiGmapGoogleMapApiProvider', function (uiGmapGoogleMapApiProvider) {
uiGmapGoogleMapApiProvider.configure({
// key: 'your api key',
v: '3.17',
libraries: 'weather,geometry,visualization'
});
}
]);
}());
는 놀랍게도 애니메이션이 작동하는 것 같다,하지만 오류를 해결하는 것을 선호 :
오류가 각도-anumate.js에서 생성됩니다이것은 :
function fireDoneCallbackAsync() {
fireDOMCallback('close');
if (doneCallback) {
$$asyncCallback(function() {
doneCallback();
});
}
}
저는 IDE로 vs2013을 사용하고 있습니다. 모든 자바 스크립트 파일과 라이브러리가 페이지 하단에 삽입됩니다. 번들이나 정규 스크립트를 통해 주입하려고 시도했지만 차이점은 없습니다.
어떤 도움을 주시면 감사하겠습니다. 감사합니다
내가 app.animation 오류 남아 전화를 언급 경우에도 (위의 코드를 참조) 을 편집했다. 그냥 ngAnimate 오류
var app = angular.module("pie", ['ui.router', 'uiGmapgoogle-maps', 'ui.bootstrap', 'ngAnimate']);
를 생성합니다 주입하면 인생이 원인이 될 수 있습니까?
"완료"기능이 문제를 일으키는 것으로 보입니다. 예상되는 입력은 function (element, className, from, to, done)입니다. 여기서 from과 to는 필수이며, done은 from, one은 객체이어야하지만 다른 것은 그렇지 않다고 생각합니까? 참조 : https://docs.angularjs.org/api/ngAnimate/service/$animate – SoluableNonagon