Search code examples
angularjsangularjs-directiveangularjs-scopeangular-uiangular-strap

trying to get angularstrap working but no luck


I am trying to get angularstrap working but have not had any luck yet. here is my angular code

<!DOCTYPE html>
<head>
    <title>Learning AngularJS</title>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script>
    <script src="//oss.maxcdn.com/angular.strap/2.0.0/angular-strap.min.js"></script>
    <script src="//oss.maxcdn.com/angular.strap/2.0.0/angular-strap.tpl.min.js"></script>
</head>
<body>
<div id='content' ng-app='MyTutorialApp' ng-controller='MainController'>
{{understand}}
</div>
<script>
    var app = angular.module('MyTutorialApp',['mgcrea.ngStrap']);
    app.controller("MainController", function($scope){
        $scope.understand = "I now understand how the scope works!";
    });
</script>
</body>
</html>

I get this error

Uncaught object ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:33

when I take mgcrea.ngStrap out from

var app = angular.module('MyTutorialApp',['mgcrea.ngStrap']);

then it works. Any help will be appreciated!

Here is a snapshot of angular debugger for dependencies


Solution

  • angularstrap depends on angular animate..

    include this <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular-animate.min.js"></script> It is already answered here : $injector:modulerr using angular-strap?

    AngularStrap is lighter and faster than ever as it does leverage the power of ngAnimate from AngularJS 1.2+!

    https://github.com/mgcrea/angular-strap/issues/651