Ember 2.7.2 and ember-models-table: A helper named "models-table" could not be found - ember.js

I install Ember 2.7.2 and I create my first application. I install the addon ember-models-table (ember install ember-models-table).
Template:
<h3>Prueba</h3>
{{models-table
data=model
columns=columns}}
I use "ember server" to test my app. When I go to http://localhost:4200/prueba I see this error in console:
Uncaught Error: Assertion Failed: A helper named "models-table" could not be found
Any idea of what is wrong?

Maybe you didn't install this addon correctly for some reason. All I can recommend you is to re-install it by typing these commands:
npm uninstall --save ember-models-table
npm prune
rm -rf node_modules tmp
npm cache clean
npm install
ember install ember-models-table
If the problem still exists after you re-install the addon, probably something is wrong with your environment, not the ember itself.

Related

Why should I use ember install over NPM or yarn?

I'm new to ember and I discover the command ember install pkg and I'm wondering why such package instead of using external package manager such as yarn or npm which are industry-wide/de-facto standard.
Question
Why should I use ember install over NPM or yarn?
ember install addon-name is a short hand for npm install --save-dev addon-name && ember g addon-name
The documentation provides the answer for this one (ctrl + f ember install):
Installs the given addon into your project and saves it to the
package.json file. If provided, the command will run the addon’s
default blueprint.
The release notes for version 0.1.5 provide a clue for this as well:
#2805 Added the install:addon command, which installs an addon with NPM and then runs the included generator of the same name if it
provides one.
So, ember install is just a replacement for npm in most cases but when a blueprint is provided it will run those as well.

Ember : downgrading ember with bower install

I've been switching to the 1.13.2 version of ember on a git branch, and now I want to come back to 1.11.1 when going back to an other branch.
I've been running npm install and bower install without failure.
But when I run ember server I run into the following error :
Missing bower packages:
Package: ember
* Specified: 1.11.1
* Installed: 1.13.2
Run `bower install` to install missing dependencies.
Running bower install again does not solve the problem, neither does bower cache clean.
Do
$ rm -rf bower_components
$ bower cache clean
$ bower install

Ember Cli on windows

I m trying to get Ember cli on Windows 7.I have installed node and npm.
But when I type npm install -g ember-cli I get the following error.Is there anything that I am missing?
Try running:
npm package.json
to see errors in the package.json file. Otherwise try:
npm cache clean

How to replace the handlebars with htmlbars in Ember CLI app?

I am facing the following issue after upgrading the Ember and Ember data to the canary versions.
Cannot set property 'compilerInfo' of undefined
I found the discussion about the issue in Ember CLI repo.
https://github.com/ember-cli/ember-cli/issues/2955
The solution is to replace handlebars with htmlbars. But I don't know the exact steps to do that.
I checked handlebars repo. It gives code snippets but I don't know where to place the code exactly.
Any idea?
You will still be using Handlebars, but you need 2.0.
For HTMLBars, what you'll change is the template compiler.
npm uninstall --save-dev broccoli-ember-hbs-template-compiler
npm install --save-dev ember-cli-htmlbars
rm -rf bower_components
bower install --save handlebars#2.0.0
bower install

npm install ember-data just installs index.js file

When I do npm install ember-data --save, I get only the following files:
./node_modules/ember-data/
./node_modules/ember-data//lib
./node_modules/ember-data//lib/ember-addon
./node_modules/ember-data//lib/ember-addon/blueprints
./node_modules/ember-data//lib/ember-addon/blueprints/ember-data
./node_modules/ember-data//lib/ember-addon/blueprints/ember-data/index.js
./node_modules/ember-data//lib/ember-addon/index.js
./node_modules/ember-data//package.json
./node_modules/ember-data//README.md
I was expecting the same files bower installs, such as ember-data.min.js.
My hunch is I need to do npm install from within node_modules/ember-data? If so, why the extra step?
ember-data is meant to be installed with bower with
$ bower install --save ember-data
Installing ember-data with npm will add it as an add-on for ember-cli project. It will include the files from bower_components. you still need the bower version.
ember-cli has built-in support for ember-data.