2016-09-20 4 views
0

문제내가 각도 JS와 jQuery를 사용했다 각도 JS

  • 에 한 번 이상 각 더로드했습니다.

오류

angular.js?v=1.6.10_1474366451:12116 TypeError: ha is not a function 
at eval (eval at <anonymous> (http://localhost/weblogs-s2/web/common/assets/libs/jquery/jquery.min.js?v=1.6.10:2:2616), <anonymous>:17:349) 
at eval (eval at <anonymous> (http://localhost/weblogs-s2/web/common/assets/libs/jquery/jquery.min.js?v=1.6.10:2:2616), <anonymous>:308:401) 
at http://localhost/weblogs-s2/web/common/assets/libs/jquery/jquery.min.js?v=1.6.10:2:2616 
at Function.globalEval (http://localhost/weblogs-s2/web/common/assets/libs/jquery/jquery.min.js?v=1.6.10:2:2627) 
at text script (http://localhost/weblogs-s2/web/common/assets/libs/jquery/jquery.min.js?v=1.6.10:4:26788) 
at Qc (http://localhost/weblogs-s2/web/common/assets/libs/jquery/jquery.min.js?v=1.6.10:4:18505) 
at x (http://localhost/weblogs-s2/web/common/assets/libs/jquery/jquery.min.js?v=1.6.10:4:21926) 
at b (http://localhost/weblogs-s2/web/common/assets/libs/jquery/jquery.min.js?v=1.6.10:4:26298) 
at Object.send (http://localhost/weblogs-s2/web/common/assets/libs/jquery/jquery.min.js?v=1.6.10:4:26402) 
at Function.ajax (http://localhost/weblogs-s2/web/common/assets/libs/jquery/jquery.min.js?v=1.6.10:4:21703) <div id="wrapper" ui-view="" class="container ng-scope">(anonymous function) @ angular.js?v=1.6.10_1474366451:12116(anonymous function) @ angular.js?v=1.6.10_1474366451:8976invokeLinkFn @ angular.js?v=1.6.10_1474366451:8527nodeLinkFn @ angular.js?v=1.6.10_1474366451:8034compositeLinkFn @ angular.js?v=1.6.10_1474366451:7435publicLinkFn @ angular.js?v=1.6.10_1474366451:7309updateView @ angular-ui-router.js?v=1.6.10_1474366451:2733(anonymous function) @ angular-ui-router.js?v=1.6.10_1474366451:2697$broadcast @ angular.js?v=1.6.10_1474366451:15893$state.transition.resolved.then.$state.transition @ angular-ui-router.js?v=1.6.10_1474366451:2114processQueue @ angular.js?v=1.6.10_1474366451:14347(anonymous function) @ angular.js?v=1.6.10_1474366451:14363$eval @ angular.js?v=1.6.10_1474366451:15574$digest @ angular.js?v=1.6.10_1474366451:15385$apply @ angular.js?v=1.6.10_1474366451:15679done @ angular.js?v=1.6.10_1474366451:10166completeRequest @ angular.js?v=1.6.10_1474366451:10338requestLoaded @ angular.js?v=1.6.10_1474366451:10279 

SourceMap 구문 분석하지 못했습니다 http://localhost/weblogs-s2/web/metisMenu.js.map JS 각 코드가

var sbAdmin2 = angular.module('sbAdmin2', ['ui.router','ngSanitize']); 


sbAdmin2.config(function($stateProvider, $urlRouterProvider) { 

$urlRouterProvider.otherwise(''); 

$stateProvider 

    // HOME STATES AND NESTED VIEWS ======================================== 
    .state('Dashboard', { 
     url: '/dashboard/data', 
     templateUrl: 'http://localhost/weblogs-s2/web/weblogs_dev.php/dashboard/data' 
    }) 

    }) 

스크립트 내가 사용하고

 <div id="wrapper" ui-view="" class="container ng-scope"> 

<html> 
    <head> 
    <script src="{{ asset ('common/assets/libs/jquery/jquery.min.js') }}?v={{ app_version }}"></script> 
    <script src="{{ asset ('common/assets/libs/jquery/jquery-ui/js/jquery-ui.min.js') }}?v={{ app_version }}"></script> 
    <script src="{{asset('common/assets/libs/angular/source/angular.js') }}?v={{ app_version }}_{{ NOW }}"></script> 
    <script src="{{ asset ('common/assets/libs/angular/source/modules/angular-ui-router.js') }}?v={{ app_version }}_{{ NOW }}"></script> 
    <script src="{{ asset ('common/assets/libs/angular/source/modules/angular-sanitize.js') }}?v={{ app_version }}_{{ NOW }}"></script> 
</head> 
    <body> 
    <div id="wrapper" ui-view class="container ng-scope" > 
    </div> 
</body> 
</html> 

난 각도 JS 라이브러리와 충돌

  • jQuery를 봤있다.
  • jquery 응용 프로그램이 제대로 작동하기 전에 각도 js를로드 할 때.
  • 하지만 데이터 테이블에 데이터를 채워야하고 데이터 테이블이 작동하지 않아야합니다.
  • 데이터 테이블을 의미하는 것은 첫 번째에서 첫 번째로로드 할 jquery가 필요합니다. 내가 필요한

    은 가능한 JS 각 라이브러리 전에 jQuery를로드하거나 충돌을 수도 있습니다.

    problem arise when i was using datatable using jquery then it would not work when i used jquery after angular js. 
    
어떤 제안이 가장 환영

답변

0

각도 1.3 만의 jQuery 2.1 이상을 지원

Angular 1.3 only supports jQuery 2.1 or above. jQuery 1.7 and newer might work correctly with Angular but we don't guarantee that.

출처 : https://docs.angularjs.org/misc/faq

그것은 당신처럼 보이는 jQuery v1.6.10을 사용합니다 (심지어 존재하는 경우). 최신 버전의 jQuery로 업데이트 해보십시오.

(또한 각도 V2를 *. 당신이 각도 V1을 사용하고 있는지 확인하지. *)

+0

안녕 다니엘 나는 우리가 – afeef

+0

우리가 symfony2의 데이터 테이블 lib 디렉토리를 사용하는 각도 JS와 jQuery를 사용할 수 없다고 생각하지만, 우리는 각 직면하고있다 .js? v = 1.6.10_1474973236 : 12116 TypeError : $ (...). dataTable이 함수가 아닙니다. – afeef

+0

jQuery를 각도 함수와 함께 사용할 수 있습니다. dataTable 스크립트를 포함하고 있습니까? jQuery 다음에 포함해야합니다. 또한 Angular가 jQuery 뒤에 포함되어 있는지 확인하십시오. –