Skip to content

ng build --prod causes Template Parse Error #1705

Closed
@jt-helsinki

Description

@jt-helsinki

I am new to angular and I have built a small application that needs to display a sortable table. It all runs fine in Angular-cli development server in development mode (using ng serve).

I've tried implementing the table with both the <ng2-table> and <angular-table> libraries so I suspect this is not a problem associated with either one of these libraries.

However when I build the application using ng build --prod for deployment onto my staging server I receive the following error inside the browser console when I try to access the application

zone.js:461 Unhandled Promise rejection: Template parse errors:
Can't bind to 'rowsOnPageSet' since it isn't a known property of 'mfBootstrapPaginator'. ("                     <td colspan="3">
                                        <mfBootstrapPaginator [ERROR ->][rowsOnPageSet]="[10,25,100]"></mfBootstrapPaginator>
                                    </td>
     "): a@42:62 ; Zone: <root> ; Task: Promise.then ; Value:

Template parse errors:↵Can't bind to 'rowsOnPageSet' since it isn't a known property of 'mfBootstrapPaginator'. ("                     <td colspan="3">↵                                        <mfBootstrapPaginator [ERROR ->][rowsOnPageSet]="[10,25,100]"></mfBootstrapPaginator>↵                                    </td>↵     "): a@42:62"

It seems that the bundling is not including the <ng2-table> and <angular-table> libraries within the build. This is either my SNAFU or a pro

I've updated my code so that it is all running using Angular 2.0.0RC5. That is, so that it uses the new @NgModule decorator.

Any help or advice you can offer would be much appreciated. I'm at an end here.

Many thanks

JT

Note: I tried temporarily specifiying the DataTableDirectives as a directive under the component's @component decorator but this didn't help.


1. OS
Mac OSX El Capitan?

2. Versions.
Angular RC5
angular-cli: 1.0.0-beta.10
node: 6.3.1

3. Repro steps.

The app was originally created using the CLI tool.

Full code is available here: https://github.com/paistipoikka/GH_DTS

  1. Clone the app and follow the instructions contained in the README.md.
  2. Run a Production build and deploy to staging server inside a directory called DTS.
  3. Access via http://localhost/dts
  4. Check browser console for error message.

4. The log given by the failure.

zone.js:461 Unhandled Promise rejection: Template parse errors:
Can't bind to 'rowsOnPageSet' since it isn't a known property of 'mfBootstrapPaginator'. ("
<mfBootstrapPaginator [ERROR ->][rowsOnPageSet]="[10,25,100]">

"): a@42:62 ; Zone: ; Task: Promise.then ; Value:

Template parse errors:↵Can't bind to 'rowsOnPageSet' since it isn't a known property of 'mfBootstrapPaginator'. (" ↵ <mfBootstrapPaginator [ERROR ->][rowsOnPageSet]="[10,25,100]">↵ ↵ "): a@42:62"

  1. Mention any other details that might be useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions