You don't need to use Angular, jQuery and JavaScript as a whole for setting up the number of items which will be shown on a different resolutions. This is a CSS issue.
Besides that you can use jQuery in Angular in a directive
, not in the controller
. The controller is not used for DOM manipulations as in it, it has to be the business logic for a specific module.
Angular has a build-in angular.element
which (if jQuery is available), is an alias for jQuery function. It wraps a raw DOM element or HTML string as a jQuery element. If jQuery's not available, angular.element
delegates to AngularJS's built-in subset of jQuery, called jQuery lite
or jqLite
.
You can read more information about using jQuery in Angular here.
$window
is Angular service which reference to the browser's window
object. You should inject it into the controller in order to use it in your controller's functions.