DevExtreme - Erro注入模块

时间:2015-12-24 17:51:49

标签: javascript angularjs

下午好,

我在开发的教程中遇到了一些困难,目的是使用DevExtreme框架在Angle中开发SAP - Single aplication页面。

插入'dx'时

var = scotchApp angular.module ('scotchApp' ['ngRoute', 'dx']);

发生此错误

$ injector: modulerr. Module Error

没有'dx'可以正常工作

var scotchApp = angular.module ('scotchApp' ['ngRoute']);

下面我留下我的代码:

<!-- index.html -->
<!DOCTYPE html>
<html ng-app="scotchApp">
<head>
<script type="text/javascript"       src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular-sanitize.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/globalize/0.1.1/globalize.min.js"></script>
<script type="text/javascript" src="http://cdn3.devexpress.com/jslib/15.2.4/js/dx.webappjs.js"></script>
<script src="script.js"></script>
<link rel="stylesheet" type="text/css" href="http://cdn3.devexpress.com/jslib/15.2.4/css/dx.common.css" />
<link rel="stylesheet" type="text/css" href="http://cdn3.devexpress.com/jslib/15.2.4/css/dx.light.css" />
<link rel="stylesheet" type="text/css" href="style.css">
</head>

<!-- HEADER AND NAVBAR -->
<header>
    <nav class="navbar navbar-default">
        <div class="container">
            <ul class="nav navbar-nav navbar-left">
                <li><a href="#">Home</a></li>
                <li><a href="#about">TimeSheets</a></li>
                <li><a href="#contact">Approval</a></li>
                <li><a href="#contact">Vacations</a></li>
            </ul>
        </div>
    </nav>
</header>

<!-- MAIN CONTENT AND INJECTED VIEWS -->
<div id="main">

    <!-- angular templating -->
    <!-- this is where content will be injected -->
    <div ng-view></div>

</div>

的js

var scotchApp = angular.module('scotchApp', ['ngRoute','dx']);
scotchApp.config(function ($routeProvider) {
$routeProvider

.when('/', {
        templateUrl: '/pages/home.html',
        controller: 'mainController'
    })

    .when('/about', {
        templateUrl: '/pages/about.html',
        controller: 'aboutController'
    })

    .when('/contact', {
        templateUrl: '/pages/contact.html',
        controller: 'contactController'
    });
})

scotchApp.controller('mainController', function ($scope) {
$scope.mensagem = 'Buenos dias';
});
scotchApp.controller('aboutController', function ($scope) {
$scope.mensagem = 'Hello';
});
scotchApp.controller('contactController', function ($scope) {
$scope.mensagem = 'Teste';
$scope.buttonText = 'O Bonito';
$scope.buttonClick = function () { alert('click click'); };
});

有人可以帮助我知道为什么我不能在我的页面中注入devextreme小部件?谢谢你,节日快乐

1 个答案:

答案 0 :(得分:0)

在angular.min.js <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular-route.min.js"></script>之后在head标签中包含ngRoute的reefernce 并且dx不是模块,在模块中注入ngSanitize