Hi Guys, I’m just new in meteorjs development and I need some help about how to properly initialize the jquery package from atmospherejs.
I know that we will just import the jquery package if from npm. But I’m curious how to use the jquery from atmosphere, I already installed jquery using meteor add jquery but when I try to use inside the component I got an error client/imports/app/dashboard/main/main.component.ts (19, 19): Cannot find name ‘$’.
But it works when I log the ‘$’.
So my question is how to properly use the jquery from atmosphere inside a component?
Here’s the code:
import { Component, OnInit,TemplateRef } from "@angular/core";
import { Demo } from "../../../../../both/models/demo.model";
import template from "./main.component.html";
@Component({
selector: "dashboard",
template
})
export class MainComponent implements OnInit {
constructor() {
}
ngOnInit() {
$(".button-collapse").sideNav();
console.log($("body"));
}
}