1

No idea why I'm getting this error here, I've used this exact type of function in other apps before. The only difference here is that I'm including this inside of an Angular Controller, could that possibly have anything to do with this error?

enter image description here

// Controller for Add Customer
app.controller('AddCustomerController', function($scope) {

    $scope.deactivate_btn = false;

    // Check all users:
    this.checkAll = function() {
        var checkboxes = document.getElementsByName('checkboxCustomer');
        var checkAll = document.getElementsByName('checkboxAll');

        for (var i = 0, n = checkboxes.length; i < n; i++) {
            checkboxes[i].checked = checkAll[0].checked;
        }
    };

    function buildAddedSiteRow(id, name, address, loc1, loc2, city, state, zip) {
        id      = id      || " ";
        name    = name    || " ";
        address = address || " ";
        loc1    = loc1    || " ";
        loc2    = loc2    || " ";
        city    = city    || " ";
        state   = state   || " ";
        zip     = zip     || " ";

        var number = 1 + Math.floor(Math.random() * 6);

        return "<tr class='added_sites_tbody'><td><div class='check-label'><input ng-click='deactivate_btn = !deactivate_btn' ng-class='{ active: deactivate_btn }' type='checkbox' name='checkAddSite' id='"+id"' class='css-checkbox' /><label for='"+id"' class='css-label radGroup1 clr'>"+id"</label></div></td><td>"+name"</td><td>"+address"</td><td><div class='add_sites_location'><p>"+loc1"</p> <p>"+loc2"</p></div></td><td>"+city"</td><td>"+state"</td><td>"+zip"</td><td></td></tr>";
    };
});

1 Answer 1

4
return "<tr class='added_sites_tbody'><td><div class='check-label'><input ng-click='deactivate_btn = !deactivate_btn' ng-class='{ active: deactivate_btn }' type='checkbox' name='checkAddSite' id='"+id"' class='css-checkbox' /><label for='"+id"' class='css-label radGroup1 clr'>"+id"</label></div></td><td>"+name"</td><td>"+address"</td><td><div class='add_sites_location'><p>"+loc1"</p> <p>"+loc2"</p></div></td><td>"+city"</td><td>"+state"</td><td>"+zip"</td><td></td></tr>";
// The errors are here ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^ and ------------------------------------^ and ---------------------------------^ and ------------------------^ and -------------^ and so on

You need + in each of those locations.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.