VadimDez / ngx-order-pipe

▼ Angular 5+ orderBy pipe
https://vadimdez.github.io/ngx-order-pipe/
MIT License
243 stars 57 forks source link

experssion not found in build project #67

Closed omryotmane closed 3 years ago

omryotmane commented 6 years ago

when i tape commande ng buil --prod

console raise an error like

ERROR in src\app\layout\setup\setup.component.html(23,54): : Property 'born_sup' does not exist on type 'SetupComponent'

but in env dev it works perfectly.

VadimDez commented 6 years ago

i can't see what ngx-order-pipe has to do with this. It seems like it's your own code that triggers the issue.

itsnotme01 commented 6 years ago

Hello, It seems I have the same trouble when I try to do this kind of things:

<select id="createMailboxLanguageDropDown" class="form-control"
     [(ngModel)]="fileContent.MailboxLanguage" name="createMailboxLanguageDropDown">
    <option *ngFor="let language of languages | orderBy: language : false : true [value]="language">{{language}}</option>
</select>

In this case the order works but the production mode build (ng build --prod) fail with the same error as @otmane-ma

If I try to add a property languageOrder or language with the value 'language' in my component the order does not work.

Do you have an hint on how to directly sort an array of string in the html?

itsnotme01 commented 6 years ago

Hello again, After some tests I found a solution for my case (sorting an array of string in an ngFor directly in the html), I just need to orderBy an empty string like this:

<select id="createMailboxLanguageDropDown" class="form-control"
    [(ngModel)]="fileContent.MailboxLanguage" name="createMailboxLanguageDropDown">
    <option *ngFor="let language of languages | orderBy: '' : false : true [value]="language"{{language}}</option>
</select>

Sorry for the inconvenience.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.