How to add plugin to Ionic 2 Plunker - ionic-framework

Hi I have the following Plunker for Ionic 2.
Ionic 2 Environment
I would like to add the Angular 2 Flex Layout(link below) to this plunker so that I have access to it on the home.html. How would I go about this?
Angular Flex Layout
Many thanks in advance.
My index looks like:
<head>
<script src="https://code.angularjs.org/tools/system.js"></script>
<script src="https://code.angularjs.org/tools/typescript.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.15/angular2-polyfills.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.15/angular2.dev.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.15/router.dev.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.15/http.dev.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.15/Rx.js"></script>
<script src="config.js"></script>
<script src="https://npmcdn.com/ionic-angular#2.0.0-beta.6/bundles/ionic.system.js"></script>
<link href="https://npmcdn.com/ionic-angular#2.0.0-beta.6/bundles/ionic.ios.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
</head>
<body>
<!-- this Ionic's root component and where the app will load -->
<ion-app></ion-app>
<script>
System.import('app.ts')
</script>
</body>
</html>

This specific plunker is actually pretty out of date for both angular and ionic. Unfortunately there doesn't seem to be one since 2.0 went stable let alone the 4.0 current branch.
You may get it to work with that somehow but I don't think it would be a good testing/example tool.
Update: I went ahead and got one working with blank settings. You can see it here: http://plnkr.co/edit/y8R0MF?p=info
And Here it is with Flex-Layout running
To add plugins you have to add them to the systemJs config with the path to the umd like:
'#angular/compiler': 'npm:#angular/compiler#4.1.2/bundles/compiler.umd.js',
which is a path to the unpacked version
Hope that helps!

Related

Why is jh_magnificpopup not working on my site?

On my site jh_magnificpopup is no longer working. jQuery seems to be there but still it is not happy... Why is this?
http://www.wannermech.ch/schlosserei/diverse-gebrauchsgegenstaende.html
you have two different versions of jquery in your site:
in the beginning (line 29):
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript"></script>
and in the end: (line 94):
<script src="typo3temp/assets/compressed/merged-c586b8f41a42376a91eae317eb6f66f9-5c96191b865a8f66f661743685d8e702.js?1540748008" type="text/javascript"></script>
which includes jQuery v2.2.3.
In such a case even the noConflict option
<script type="text/javascript">
/*<![CDATA[*/
jQuery.noConflict();
/*]]>*/
</script>
might induce more confusion

sails.js and foundation 6 - TypeError: url.indexOf is not a function

I am trying to use sails.js and Zurb Foundation 6.2. I used this handy npm generator that sets up my grunt tasks. The output looks pretty good. I have a single js file that contains jquery, foundation, etc.
In my layout.ejs, I have this:
<!DOCTYPE html>
<html>
<head>
<title><%=typeof title == 'undefined' ? 'New Sails App' : title%></title>
<!-- Viewport mobile tag for sensible mobile support -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!--STYLES-->
<link rel="stylesheet" href="/styles/app.css">
<!--STYLES END-->
</head>
<body>
... some html ...
<%- body %>
<!--SCRIPTS-->
<script src="/js/dependencies/sails.io.js"></script>
<script src="/js/dependencies/foundation.js"></script>
<!--SCRIPTS END-->
<script>
$(document).foundation();
</script>
</body>
</html>
When I run the page, I get this error:
**TypeError: url.indexOf is not a function
jQuery.fn.load()
foundation.js:9612
<anonymous>
foundation.js:11913
<anonymous>**
My reading on this suggests that the issue is either that something is not be loaded, is being loaded more than once, or is in the wrong order. How do I narrow that down? I tried to use CDN's for each piece and still couldn't make it work.
Thank you for your help.
Foundation is not currently compatible with jQuery 3.0.0, Foundation is using the deprecated jQuery.fn.load(). Use jQuery 2.2.x for now. See issue and PR:
https://github.com/zurb/foundation-sites/issues/8834
https://github.com/zurb/foundation-sites/pull/8923

CoffeeScript from CDN above 1.4.0 cannot call JavaScript function

CoffeeScript code is not working when the 1.10.0 version coffee-script.min.js is linked.
<!DOCTYPE html>
<html lang="en">
<head> <meta charset='utf-8'> </head>
<body>
<div id="myDiv">Content</div>
</body>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js" > </script>
<!--
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/coffee-script/1.4.0/coffee-script.min.js" > </script>
-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/coffee-script/1.10.0/coffee-script.min.js" > </script>
<script type="text/coffeescript" >
$("#myDiv").text "New Content"
alert "Hello world"
</script>
</html>
The latest working CDN coffee-script.min.js is 1.4.0. What is the problem?
Those script hosted in CDN are not for browser, I think.
I tried your code, and as you say it did not work and there was the following console log.
Uncaught ReferenceError: require is not defined
require is a specification of commonJS and it is not implemented in browser default.
If you would not like to compile and make it work easily, the code below is available.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
</head>
<body>
<div id="myDiv">Content</div>
</body>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js">
</script>
<script type="text/javascript" src="http://coffeescript.org/extras/coffee-script.js"></script>
<script type="text/coffeescript">
$("#myDiv").text "New Content"
alert "Hello world"
</script>
</html>
This way is introduced at the official site.
http://coffeescript.org/
While it's not recommended for serious use, CoffeeScripts may be included directly within the browser using tags. The source includes a compressed and minified version of the compiler (Download current version here, 39k when gzipped) as extras/coffee-script.js. Include this file on a page with inline CoffeeScript tags, and it will compile and evaluate them in order.
Error in packaging on the part of the CDN provider, see here:
https://github.com/jashkenas/coffeescript/issues/3811
https://github.com/cdnjs/cdnjs/issues/4869

Tinymce is not Displaying at at all

Hy There...!
I have some problems when its come to Jquery ..............
Here i am trying to use TinyMCE Text Editor... I had download its Js File and some code with it mention it in there site...
But When i see my index.HTML it is all Blank.....
Which i don't understand Please Any Help or hint will be appreciated........
Thanks in Advance ... Here Is The Code
<html>
<head>
<script type="text/javascript" src="tinymce.js"></script>
<script type="text/javascript">
tinymce.init({
selector: "textarea"
});
</script>
</head>
<body>
<form method="post" action="index.html">
<textarea name="content" style="width:100%" class="mceEditor"></textarea>
</form>
</body>
</html>
I believe you are not linking the tinymce.js file correctly. Make sure it's linked correctly relative to the directory of index.html file.
I used the same markup you provided and made it work in jsFiddle using the script from TinyMCE CDN.
http://jsfiddle.net/AHXXT/

jqGrid table off of DOM

I am trying to get jqGrid to work off a DOM table that already exists. I am a little confused with some of the instructions to do this however... For instance, I read this on one particular help site...
http://www.secondpersonplural.ca/jqgriddocs/_2h30t8wte.htm
When he says this:
"the new release of jquery.jqGrid.js defaults to this module being enabled, so ensure that grid.tbltogrid.js and grid.tbltogrid-min.js are copied to the appropriate folder. If you do not wish to include this function, make the appropriate change to jquery.jqGrid.js."
What is he talking about?
Also, the Jquery grid download site gave me this set of instructions:
"In order to use this module you should mark the Table to Grid (in Other modules) when you download the grid. For more information refer to Download.
For Developers - this is the grid.tbltogrid.js in the src directory."
Now I had the Table to Grid module marked when I downloaded.
What would I should be doing to get this done?
What function should I be calling, currently I am calling...
(function () {
tableToGrid(".table1", {});
});
That seems a little bit wrong.
UPDATE: Added what I reference
Here are the scripts that I reference... Ignore the DataTable scripts... I will soon be removing them once I can confirm that this works.
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="~/Content/jqUIcss/jquery-ui-1.8.14.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="~/Content/jqGrid/ui.jqgrid.css" />
<script type="text/javascript" src="<%=ResolveClientUrl("~/Scripts/jquery-1.5.1.min.js")%>"></script>
<link href="../../Content/dataTable.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=ResolveClientUrl("~/Scripts/jqUI/jquery-ui-1.8.14.custom.min.js")%>"></script>
<script src="<%=ResolveClientUrl("~/Scripts/lib/jquery.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/lib/jquery.metadata.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jquery.validate.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jquery.jqGrid.min.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/grid.locale-en.js")%>" type="text/javascript"></script>
Assuming you did download the components correctly and included them in your application through <script> tags, all you seem to have to do is:
tableToGrid('#table_name')
where the table name is the id of the table you're trying to convert.
Edit: Note the #, whereas you used . and what seems to be a table ID. . signifies a class name.
<script src="<%=ResolveClientUrl("~/Scripts/grid.base.js")%>" type="text/javascript"> </script>
<script src="<%=ResolveClientUrl("~/Scripts/grid.tbltogrid.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jqDnR.js")%>" type="text/javascript"></script>
Added these scripts and things seem to be fine.