Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng-admin 0.3.2 : label is undefined #123

Closed
2anandkr opened this issue Nov 15, 2014 · 10 comments
Closed

ng-admin 0.3.2 : label is undefined #123

2anandkr opened this issue Nov 15, 2014 · 10 comments
Labels

Comments

@2anandkr
Copy link

I downloaded the app (ver. 0.3.2) yesterday & Configured it but it bugged!

var user = new Entity('users');
 app.addEntity(user); 
user
    .label('Recent Users')   // does not work

angular throws this:

Uncaught Error: [$injector:modulerr] Failed to instantiate module adminApp due to:
TypeError: undefined is not a function
    at http://localhost:3000/config.js:41:8   --> points to where label(..) is defined

If I remove label(..) call, it shows the dashboard correctly.
But when I click the items on left (to list the users), angular again throws:

TypeError: undefined is not a function
    at new a (http://localhost:3000/ng-admin-app/bower_components/ng-admin/build/ng-admin.min.js:9:11646)

In the page, I see this: {{ listController.title }}

Inspecting the above ng-admin.min.js the error points to section: this.entityLabel=this.view.label()

How to get rid of it?

@fzaninotto
Copy link
Member

I think this is already fixed on master. You'll have to use 'title' instead of 'label'.

@2anandkr
Copy link
Author

Ok! that solved one problem. But the problem still remains, when I click the link on left (which goes to http://localhost:3000/admin#/list/users?page=1) to list users, with this code:

    .addView(new ListView('user-list') // initialize the datagrid
      .title('All users')
      .addField(new Field('id'))
      .addField(new Field('name')) 
    )

I get this :

TypeError: undefined is not a function
    at new a (http://localhost:3000/ng-admin-app/bower_components/ng-admin/build/ng-admin.min.js:9:11646)

Here is the page screenshot:
ng-admin-error-screenshot1

@2anandkr
Copy link
Author

I got it working now!
I downgraded to version 0.3.1 and it works. However, In DashboardView, label(..) works & not title(..). I figured it out from your demo source: https://github.com/marmelab/ng-admin-demo. It is using version 0.3.1. You should consider fixing this bug in ver 0.3.2.
Thanx! for creating this app. We can now concentrate on our app logic instead of designing an admin interface from scratch.

@fzaninotto
Copy link
Member

could you try again with master?

@fzaninotto fzaninotto added the bug label Nov 20, 2014
@2anandkr
Copy link
Author

Same errors. I tried using:
bower install --save https://github.com/marmelab/ng-admin.git
I'm wondering why it is working for you & not for me.
I also tried installing the whole ng-admin dependencies separately on a new bower_components folder but still the same bugs.

@fzaninotto
Copy link
Member

I think we need to release a new tag for your version to be upgraded. Ping @manuquentin

@manuquentin
Copy link
Contributor

Done

@fzaninotto
Copy link
Member

@2anandkr could you try again?

@2anandkr
Copy link
Author

Yuppy! It's working now! I'm using version 0.3.3 . Thank you for fixing it!

@fzaninotto
Copy link
Member

Glad it works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants