3
3
3ds2012-08-27 21:17:56
JavaScript
3ds, 2012-08-27 21:17:56

Angularjs: [object Error]undefined IE8???

I have already tried everything, tell me where the error can be? ..
main page:

<html xmlns:ng="http://angularjs.org" class="ng-app:work" id="work" ng-app="work">
<head>
<!--[if lte IE 8]>
<script>
    document.createElement('ng-view');
</script>
<![endif]-->
......

<body>
..........
<divng-view></div>
.....


further in work.js

var work = angular.module('work', []).
    config(function($routeProvider){
        $routeProvider.
            when('/', {controller:workCtrl, templateUrl:'/ang/work/list.html'}).
            when('/log/:memberId', {controller:logCtrl, templateUrl:'/ang/work/log.html'}).
            when('/edit/:itemId', {controller: itemEditCtrl, templateUrl:'/ang/work/edit.html'}).
            when('/add/', {controller:workNewCtrl, templateUrl:'/ang/work/add.html'}).
            when('/add-log/:memberId', {controller:logNewCtrl, templateUrl:'/ang/work/add-log.html'}).
            otherwise({redirectTo:'/'});
    });

//controller
function workCtrl($scope, $http, $location){
    $http({
        method: 'POST',
        headers: 'application/x-www-form-urlencoded',
        url: "/ang/work/ajax.php",
        data: {'action':"list" }
    }).success(function (data, code) {
        $scope.list = data.list;
        $scope.status = "";
    });

    // show status while loading member
    $scope.status = "loading works direct";

    // return member count
    $scope.list_count = function(){
        if ($scope.list){
            return $scope.list.length;
        } else {
            return 0;
        }
    }

    // del
    $scope.del_item = function(id){
        $http({
            method: 'POST',
            headers: 'application/x-www-form-urlencoded',
            url: "/ang/work/ajax.php",
            data: {'action':"del", "id":id }
        }).success(function (data, code) {
            $scope.status = "deleted";
            var old_list = $scope.list;
            $scope.list = [];
            if (data.data == 'ok'){
                angular.forEach(old_list, function(item){
                    if (item.id != id) $scope.list.push(item);
                });
            }
        });
    }//*/
}



and so on… it pops up: [object Error]undefined
who managed to fix it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
3
3ds, 2012-08-28
@3ds

Changed to this, everything works:

<!DOCTYPE html>
<html xmlns:ng="http://angularjs.org">
...........
<body>
.......
<div ng-view class="ng-app:work" id="ng-app" ng-app="work"></div>
.......

F
freeek, 2012-08-27
@freeek

Use :)

if (!window.var) var =

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question