Angular throw error $parse: ueoe Unexpected End of Expression

14,800

I believe the error might be cause of the src attribute

ng-include src="'/admin/navbar/navbar.template.html'"
ng-include src="'/admin/breadcrumb/breadcrumb.template.html'"

should be

ng-include="'/admin/navbar/navbar.template.html'"
ng-include="'/admin/breadcrumb/breadcrumb.template.html'" 

src should be the attribute only when included as an element <ng-include

But in you case the ng-include is used as an attribute

For more info check the docs ng-include

Share:
14,800
Admin
Author by

Admin

Updated on June 27, 2022

Comments

  • Admin
    Admin almost 2 years

    This part of my site is with an error and i can't figure out, since i didn't change that in months.

    The error is:

    Error: [$parse:ueoe] http://errors.angularjs.org/1.4.3/$parse/ueoe?p0=event._id%3FEventController
        at Error (native)
        at http://localhost:3000/scripts/libs.js:44598:416
        at Object.q.consume (http://localhost:3000/scripts/libs.js:44801:157)
        at Object.q.ternary (http://localhost:3000/scripts/libs.js:44794:497)
        at Object.q.assignment (http://localhost:3000/scripts/libs.js:44794:284)
        at Object.q.expression (http://localhost:3000/scripts/libs.js:44794:237)
        at Object.q.filterChain (http://localhost:3000/scripts/libs.js:44794:145)
        at Object.q.expressionStatement (http://localhost:3000/scripts/libs.js:44794:91)
        at Object.q.program (http://localhost:3000/scripts/libs.js:44793:458)
        at Object.q.ast (http://localhost:3000/scripts/libs.js:44793:257) <li class="controller__item controller__item--disabled" data-controller-range="[1, 1]" data-event-sidebar-to="false" ng-click="event._id ? EventController.update(event._id, event) : EventController.create(event)">
    

    According to angular.js:

    Error: $parse:ueoe Unexpected End of Expression Unexpected end of expression: event._id Description Occurs when an expression is missing tokens at the end of the expression. For example, forgetting a closing bracket in an expression will trigger this error.

    To resolve, learn more about Angular expressions, identify the error and fix the expression's syntax.

    The HTML template:

    <main class="main">
        <div ng-include src="'/admin/navbar/navbar.template.html'"></div>
        <div ng-include src="'/admin/breadcrumb/breadcrumb.template.html'"></div>
        <section class="events">
            <div class="events__container">
                <div class="events__row">
                    <div class="col-md-12">
                        <div class="events__box">
                            <div class="events__header">
                                <h2 class="events__title"> Todos os eventos - </h2>
                            </div>
                            <div class="events__body">
                                <table class="events__table" data-table>
                                    <!-- directive:table-sorter-directive -->
                                    <thead>
                                        <tr>
                                            <th class="events__th events__th--all">
                                                <input type="checkbox" />
                                            </th>
                                            <th class="events__th"> Nome </th>
                                            <th class="events__th"> Data </th>
                                            <th class="events__th events__th--reservations"> Reservas </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr class="events__tr" ng-repeat="event in events">
                                            <td class="events__td events__td--checkbox">
                                                <input type="checkbox" data-controller-input ng-click="EventController.retrieveOne(event._id)"/>
                                            </td>
                                            <td class="events__td"> {{ event.name }} </td>
                                            <td class="events__td"> {{ event.date }} </td>
                                            <td class="events__td events__td--reservations"> 50 </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <aside class="events__sidebar" data-event-sidebar>
                    <!-- directive:event-sidebar-directive  -->
                    <form class="events__sidebar-form" method="POST" action="#">
                        <div class="events__sidebar-group">
                            <label class="events__sidebar-label" for="event_value"> Valores: </label>
                            <input class="events__sidebar-input event__sidebar-input--value" type="text" id="event_value" ng-model="event.men"/>
                            <input class="events__sidebar-input event__sidebar-input--value" type="text" id="event_value" ng-model="event.women"/>
                        </div>
                        <div class="events__sidebar-group">
                            <label class="events__sidebar-label" for="event_name"> Nome do evento: </label>
                            <input class="events__sidebar-input" type="text" id="event_name" ng-model="event.name"/>
                        </div>
                        <div class="events__sidebar-group">
                            <label class="events__sidebar-label" for="event_hour"> Hora: </label>
                            <input class="events__sidebar-input" type="text" id="event_hour" ng-model="event.hour"/>
                        </div>
                        <div class="events__sidebar-group">
                            <label class="events__sidebar-label" for="event_point"> Ponto de encontro: </label>
                            <input class="events__sidebar-input" type="text" id="event_point" ng-model="event.meeting"/>
                        </div>
                        <div class="events__sidebar-group">
                            <label class="events__sidebar-label" for="event_info"> Informações simples: </label>
                            <input class="events__sidebar-input" type="text" id="event_info" placeholder="1 Hora de Open Bar + 2 horas de loucura"/>
                        </div>
                        <div class="events__sidebar-group">
                            <label class="events__sidebar-label" for="event_hiw"> Como funciona: </label>
                            <input class="events__sidebar-input" type="text" id="event_hiw" ng-model="event.hiw"/>
                        </div>
                    </form>
                </aside>
            </div>
        </section>
        <aside class="controller" data-controller> 
            <!-- directive:controller-directive -->
            <!-- directive:controller-action-directive  -->
            <div class="controller__controller" data-controller-indicator>
                <i class="icon icon__cogs"></i>
            </div>
            <div class="controller__container">
                <ul class="controller__list">
                    <li class="controller__item"                            data-controller-range="[0]" data-event-sidebar-to="true" ng-click="EventController.clean()">
                        <i    class="icon icon__plus icon__2x"></i>
                        <span class="controller__legend"> Novo </span>
                    </li>
                    <li class="controller__item controller__item--disabled" data-controller-range="[1, 1]" data-event-sidebar-to="true">
                        <i    class="icon icon__pencil icon__2x"></i>
                        <span class="controller__legend"> Editar </span>
                    </li>
                    <li class="controller__item controller__item--disabled" data-controller-range="[1, 1]" data-event-sidebar-to="false" ng-click="event._id ? EventController.update(event._id, event) : EventController.create(event)">
                        <i    class="icon icon__cloud icon__2x"></i>
                        <span class="controller__legend"> Salvar </span>
                    </li>
                    <li class="controller__item controller__item--disabled" data-controller-range="[1]" data-event-sidebar-to="false" ng-click="EventController.delete(event._id)">
                        <i    class="icon icon__trash icon__2x"></i>
                        <span class="controller__legend"> Deletar </span>
                    </li>
                    <li class="controller__item controller__item--email">
                        <i    class="icon icon__search icon__2x"></i>
                        <span class="controller__legend"> E-mail </span>
                    </li>
                    <li class="controller__item controller__item--search">
                        <i    class="icon icon__envelope icon__2x"></i>
                        <span class="controller__legend"> Pesquisar </span>
                    </li>
                </ul>
            </div>
        </aside>
    </main>
    

    EventController.js:

    'use strict';
    var EventController = function(scope, EventModel) {
        this.scope      = scope;
        this.EventModel = EventModel;
        this.scope.store = [];
    
        this.retrieve();
    };
    
    EventController.prototype = {
        clean: function() {
            this.scope.event = {};
        },
    
        create: function(newEvent) {
            this.EventModel.Model.insert(newEvent)
                .then(function(result) {
    
                });
        },
    
        retrieve: function() {
            var that = this;
    
            this.EventModel.Model.find()
                .then(function(result) {
                    that.scope.events = result;
                });
        },
    
        retrieveOne: function(eventId) {
            var that = this;
    
            this.EventModel.Model.findOne(eventId)
                .then(function(result) {
                    that.scope.event = result;
                });
        },
    
        update: function(editedEvent, event) {
            this.EventModel.Model.update(editedEvent, event)
                .then(function(result) {
    
                });
        },
    
        delete: function(eventId) {
            this.EventModel.Model.remove(eventId)
                .then(function(result) {
    
                });
        }
    };
    
    angular.module('adminApp').controller('EventController', ['$scope', 'EventModel', EventController]);
    

    I can't figure out what is the problem. Anybody can help?

    Thanks.