AngularJS:未捕获错误:[$ injector:modulerr]和jsfiddle

时间:2017-08-10 18:30:37

标签: angularjs jsfiddle

为什么这个简单的脚本会在控制台中抛出一个未捕获的错误:[$ injector:modulerr]?

<script>
angular.module('HelloWorldApp', []);
angular.module('HelloWorldApp').controller('HelloWorldController', function($scope) {
       $scope.greeting = "Hello World";
});
</script>
<div ng-app="HelloWorldApp">
    <div ng-controller="HelloWorldController">
        <h1>{{greeting}}</h1>
    </div>
</div>

https://jsfiddle.net/Lccfcrwm/

2 个答案:

答案 0 :(得分:3)

让你的小提琴工作,实际上在javascript窗格中你需要选择角度1.x版本它将开始工作

这里是小提琴:https://jsfiddle.net/2xxf507e/

 angular.module('HelloWorldApp', []);
 angular.module('HelloWorldApp').controller('HelloWorldController', function($scope) {
       $scope.greeting = "Hello World";
});

Setting Image

和设置图像

答案 1 :(得分:2)

您必须在HTML中添加:

<div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("About", "About", "Home")</li>
                    <li>@Html.ActionLink("Free Trial Setup", "Trial", "Home")</li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Account Info</a>
                        <ul class="dropdown-menu multi-level" role="menu" aria-labelledby="dropdownMenu">
                            <li>@Html.ActionLink("License Details", "License", "Home")</li>
                            <li class="dropdown-submenu">
                                <a tabindex="-1" href="#">Billing and Payment</a>
                                <ul class="dropdown-menu">
                                    <li>@Html.ActionLink("Invoices", "Invoices", "Home")</li>
                                    <li>@Html.ActionLink("Payments", "Payments", "Home")</li>
                                    <li>@Html.ActionLink("Billing Information", "Billing", "Home")</li>
                                    <li class="dropdown-submenu">
                                        <a href="#">Users</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="#">User Settings</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                    </li>
                </ul>
                @Html.Partial("_LoginPartial")
            </div>

这是一个简单的例子:

ffmpeg -i input.jpg -vf ffmpeg -i in.mp4 -filter:v "crop=out_w:out_h:x:y" out.mp4