Angular-Meteor Pagination - angular-meteor

I would like to use a Pagination for my Angular-Meteor app. Unfortunately, I have not found an official package for this. But I found this package: https://github.com/alethes/meteor-pages.
I use the md-data-table for my app: https://github.com/daniel-nagy/md-data-table
I have only no idea how I can use the two packages together. My table looks like this:
<table md-table>
<tr md-row>
<th><span>My Prop</span></th>
</tr>
</td>
<td md-cell>{{myprop.value}}</td>
</tr>
</table>
Can I use the meteor-pages package to return a cursor I can use, or how could I connect this two different packets?

The official angular meteor site suggests that you use angular-utils-pagination package:
meteor npm install --save angular-utils-pagination

Related

How can I get my images to appear in my Netlify website? (sveltekit app)

I created a repo using sveltekit and successfully deployed it with Netlify, however the images will not load, their 'alt' attribute is all that shows up as seen in the image.
If I run the project locally using 'npm run dev' the images DO appear fine.
Here is the code where I have the img tags:
<ul>
<li><img src="/src/images/github.png" alt=GitHub></a></li>
<li><img src="/src/images/linkedin.png" alt=LinkedIn></a></li>
<li><img src="/src/images/email.png" alt=Email></a></li>
</ul>
Do I need to edit the paths somehow? Or maybe something in my svelte.config.js file:
import adapter from '#sveltejs/adapter-netlify';
/** #type {import('#sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter(),
}
};
export default config;
Put your image to this site https://cloudinary.com and get the link of the image and then try to use the link in src this will help you from the error.
Not very sure but SSR of sveltekit might be a problem in this case (Try vercel they seem to have better SSR support)! And yeah try putting your images in static folder .

What is best practice for image src in vue SFC?

I am using Laravel 5.8 and Vue 2.6 and trying to use a relative path for an image file in my single file component. I have reviewed the suggestions in How to import and use image in a Vue single file component?
but cannot get it to work.
When trying:
<template>
<div id="app">
<img src="./assets/logo.png">
</div>
</template>
<script>
export default {
}
</script>
<style lang="scss">
</style>
I get this:
This relative module was not found:
* ./assets/logo.png in ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib?
?vue-loader-options!./resources/js/components/xxxx.vue?vue&type=template&id=abd0e146&scoped=true&
When I try:
<template>
<div id="app">
<img :src="image" />
</div>
</template>
<script>
import image from "./assets/logo.png"
export default {
data: function () {
return {
image: image
}
}
}
</script>
<style lang="scss">
</style>
I get:
This relative module was not found:
* ./assets/logo.png in ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js /components/xxxx.vue?vue&type=script&lang=js&
Am I missing something with webpack-mix or vue-loader?
Edit:
Using simple static reference (src="/assets/logo.png") works on local development server, but doesn't on production server.
I've seen numerous suggested solutions for this basic image file referencing, but puzzled that there are so many possibilities and not a single best practice. Again, hoping to find a Best Practice when using Laravel/Laravel Mix/Vue and SFC that works in development and production.
There are 2 ways of using an image in your setup:
Bundled with webpack
<img src="./assets/logo.png">
import image from "./assets/logo.png"
These bundle the image using webpack, and using this solution you get the benefits of:
Automatic inlinening with base64 for small images
Automatic "deep" compressing with any webpack loaders
Path works from every path in your app
Compile time checking if the file exists
Using your own webserver
const image = '/assets/logo.png'
const image = 'http://example.com/’
In these solutions, you need to setup your webserver yourself to serve those resources (or put them in the public directory)
Easy changing to a different image without rebuilding the front end
More flexible
The answer to this is that the wrong deployment for the production server was being used that tried pointing to the 'public' folder instead of locating the public files on public_html.
After deploying according to this post, of course relative paths work exactly the same on development and production servers.
The only difference is in Step 5 for Laravel 5.8 in the server.php file,
Change
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
return false;
}
To
if ($uri !== '/' && file_exists(__DIR__.'/public_html'.$uri)) {
return false;
}
Relative paths like
<img src="img/logo.png">
on either server work the same.
It's unfortunate that Laravel docs don't go into more detail on this method of deployment since I suspect there are numerous developers wanting to deploy on shared servers at least for testing purposes.
Use
<img src="#/assets/logo.png">
This will use webpack and created a hashed version of your logo.png.
Or in JS use:
:src="require('#/assets/logo.png');
Provided that your image is stored in public folder and is accessible, you can link to it by absolute path just fine instead of using a relative path ./
<template>
<div id="app">
<img src="/public/img/widgets/logo.png" />
</div>
</template>
<script>
export default {};
</script>
<style lang="scss">
</style>
Given you have this structure
Hope this helps

can't use OR in blade template

When I am developing locally on win10 php7.2 nginx expression like this works just fine
<div class="{{ $menuclass or 'menu'}}">
which gives
<div class="menu">
but as soon as I deploy it via laravel forge to ubuntu machine it fails to work and I get this
<div class="1">
It seems that instead of doing this:
isset($menuclass ) ? $menuclass : 'menu'
it just returns 1
Any ideas why?
This feature was blogged about here: https://laravel-news.com/blade-or-operator
Has it been deprecated in later versions of laravel?
Laravel or operator was changed in laravel 5.7 to ??
The or Operator Likelihood Of Impact: High
The Blade "or" operator has been removed in favor of PHP's built-in ??
"null coalesce" operator, which has the same purpose and
functionality:
try this:
<div class="{{ $menuclass ?? 'menu'}}">
here is the upgrade guide.

AWS Elastic Beanstalk

I have my rails app deployed with AWS Elastic beanstalk. However, when I open my app through Beanstalk environment, everything works fine except the images are not being shown. I tried many things to make it show but still not able to.
Can anyone help me?
I assume you are using Rails. If that's the case, you are missing the asset_path function.
Instead of:
<img src = "/assets/abc.jpg" />
You have to use something like:
<img src = "<%= asset_path('abc.jpg') %>" />
more info here: http://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-asset_path

Ckeditor 3.7.1 + Paperclip (Absolute Paths in Email)

I have installed the ckeditor 3.7.1 and Paperclip gems (gem 'ckeditor', '3.7.1' gem 'paperclip') in Rails 3.2.3 by following the instructions posted on github (https://github.com/galetahub/ckeditor). It all seems to be working except that when I try to send an email with AccountMailer using the html (which contains uploaded images) generated from the ckeditor it gives me this:
<img alt=3D"logo" src=3D"/assets/logo= .png" />
when I want this:
<img alt=3D"logo" src=3D"www.mydomain.com/assets/logo= .png" />
I've found the documentation very confusing and the gem does not provide access to config.js in order to modify baseHref. I've tried changing the attachment_file.rb and picture.rb in model/ckeditor so that the url includes the domain but this breaks the uploading capability. I've also tried ckeditor_rails but this removes uploading capability and I do not have time
to create custom browsers and uploaders.
Any help is appreciated. Thanks!
Add the function in your Ckeditor::Picture Model
def url_content
if Rails.env.production?
host_url="http://your_domen"
else
host_url="http://localhost:3000"
end
host_url+url(:content)
end

Resources