Answer the question
In order to leave comments, you need to log in
How to do something in Angular?
<div id="content" ng-app="GridSystem">
<div ng-view></div>
</div>
<script type="text/javascript">
app.run(
function($rootScope) {
$rootScope.actionMain = '<?php echo $action ?>';
$rootScope.token = "<?php echo $token ?>";
$rootScope.toId = "<?php echo $module_id ?>";
$rootScope.storeUrl = "<?php echo $store_url ?>";
});
</script>
angular.module('GridSystem', ['ngRoute','ngResource'])
.config(function($routeProvider, $rootScope){
$routeProvider.when($rootScope.storeUrl+'/',
{
templateUrl: "flex/IceStart.html",
controller: 'IceStart'
});
$routeProvider.when('/creat',
{
templateUrl:'flex/CreatGrid.html',
controller:'CreatGridController'
});
$routeProvider.when($rootScope.storeUrl+'/:'+$rootScope.token+':toid',
{
controller: 'EditController'
})
$routeProvider.otherwise({
template: "This route isn't set!"
});
});
function MainCtrl($scope) {
....
}
https://code.angularjs.org/1.4.0/angular.min.js
https://code.angularjs.org/1.4.0/angular-route.min.js
https://code.angularjs.org/1.4.0/angular-resource.min.js
Answer the question
In order to leave comments, you need to log in
You have two links, they have different errors.
So what is the error anyway?
UPD: codepen.io/AMar4enko/pen/rVzaYY
There are comments there. I think they will be enough.
ngRoute is not optionally supplied, it must be additionally included in html.
As it says in the link, by the way:
Using ngRoute
In AngularJS 1.2.0 and later, ngRoute has been moved to its own module. If you are getting this error after upgrading to 1.2.x or later, be sure that you've installed ngRoute.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question