AngularJS在IBM MobileFirst中给出了注入器错误

时间:2016-05-24 08:57:48

标签: angularjs ibm-mobilefirst

我在IBM MobileFirst FrameWork中使用AngularJS,我收到的错误

  

worklight.js:5359未捕获异常:未捕获错误:[$ injector:modulerr] http://errors.angularjs.org/1.5.5/ $ injector / modulerr?p0 = ng& p1 = TypeError%3A%... Fpreview%2FAB%2Fcommon%2F0%2Fdefault %2Flibrary%2Fangular.min.js%3A39%3A321)at(compiled_code):40WL.Logger .__ log @ worklight.js:5359PUBLIC_API。(anonymous function)@ worklight.js:5741WL.Logger.window.onerror @ worklight.js :5699   angular.min.js:6未捕获错误:[$ injector:modulerr] http://errors.angularjs.org/1.5.5/ $ injector / modulerr?p0 = ng& p1 = TypeError%3A%... Fpreview%2FAB%2Fcommon%2F0%2Fdefault%2Flibrary%2Fangular。 min.js%3A39%3A321)"

<controls:DataGridTemplatedColumn  d:DataContext="{d:DesignInstance Type=models:SkuList}" CanSort="False" > 
                                    <controls:DataGridTemplatedColumn.Header>
                                        <Button x:Uid="RQty" Height="40" Width="110"  Style="{StaticResource RoundButtonTemplate}"  Margin="-10,0,0,0"/>
                                    </controls:DataGridTemplatedColumn.Header>
                                    <controls:DataGridTemplatedColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Width="20" Height="30">
                                                <TextBlock Name="quantity" Text='{Binding quantity}' VerticalAlignment="Center" Margin="0,5,0,0"></TextBlock>
                                            </StackPanel>
                                        </DataTemplate>
                                    </controls:DataGridTemplatedColumn.CellTemplate>
                                </controls:DataGridTemplatedColumn>
// ************ app.js *******************

var app = angular.module('myApp',['ui.router']);

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

    $urlRouterProvider.otherwise('/login');

    $stateProvider
        .state('login',{
            url:'/login',
            templateUrl:'view/login.html',
            controller:'loginController'
        });

});



// ******************  login.js ******************

app.controller('loginController',function($scope){});
<!-- INDEX.HTML -->

<!DOCTYPE HTML>
<html>
        <head>
            <meta charset="UTF-8">
            <title>AB</title>
            <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
            <!--
                <link rel="shortcut icon" href="images/favicon.png">
                <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> 
            -->
            <link rel="stylesheet" href="css/main.css" />
            <link rel="stylesheet" href="css/bootstrap.min.css" />
            <link rel="stylesheet" href="css/bootstrap-responsive.min.css" />
            <script src="library/jquery.min.js"></script>
            <script src="library/angular.min.js"></script>
            <script src="library/angular-ui-router.min.js"></script>
            <script src="library/bootstrap.min.js"></script>
            <script src="controller/app.js"></script>
            <script src="controller/login.js"></script>
            <script>window.$ = window.jQuery = WLJQ;</script>
        </head>
        <body style="display: none;" ng-app="myApp">
            <!--application UI goes here-->

            <div ui-view id="view"></div>

            <script src="js/initOptions.js"></script>
            <script src="js/main.js"></script>
            <script src="js/messages.js"></script>
        </body>
</html>

1 个答案:

答案 0 :(得分:1)

Angular 1.5不兼容,请参见此处:Ionic Mobile First Integration

您可能需要下载旧版本。