Unable to load ionic css file(s) compiled from sass (.scss) using gulp-sass - ionic-framework

I'm trying to move an application over from a Grunt build to Gulp. My Gulp build generates a ionic.css file which I attempt to load with a link tag in my index.html. I get an error in my chrome inspector that the file is not found at that path even though I can see in my www folder that it is.
My Code
gulp-sass task
gulp.task('styles', ['clean-styles'], function () {
gulp.src( './app/lib/scss/ionic/ionic.scss' ) //get the sass files
.pipe(sourcemaps.init()) //load internal sourcemap
.pipe(sass()) //convert sass to css
.pipe(sourcemaps.write()) //write inline sourcemap
.pipe(gulp.dest( './www/lib/css/' )); //push the css to www/lib/css
});
index.html head
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/css/ionic.css" rel="stylesheet">
</head>
My directory structure
my_app
-app
-lib
-fonts
-js
-scss
-src
-images
-scss
-page_view1
-templates
page_view1_controller.js
-page_view2
-templates
page_view2_controller.js
-hooks
-node_modules
-platforms
-plugins
-www
-img
-js
-lib
-css
ionic.css
-fonts
-ionic
ionicons.eot
ionicons.svg
ionicons.ttf
ionicons.woff
-js
-angular
-angular-animate
-angular-bootstrap
-angular-sanitize
-angular-ui-router
-collide
-ionic
ionic-angular.js
ionic.bundle.js
ionic.js
-ngCordova
cordova.js
cordova_plugins.js
device.js
keyboard.js
index.html
gulpfile.js
ionic.project
package.json

There is a problem with gulp minify install gulp uglify

Related

Ganglia-web how-to add favicon

I cant't add favicon in Ganglia-web
Ganglia-web use dwoo templates, and i not found tag
<head></head>
in default index.php
Need add next string:
<link href="favicon.ico" rel="icon" type="image/x-icon" />
in templates/default/header.tpl
File favicon.ico put in webroot directory

Ionic serve does not load angular js and ionic css

I am new in this Ionic field. I created a new app in my localhost folder(C:\xampp\htdocs). When I go to "http://localhost/ionapp/www/" everything works fine but when I run the app from "ionic serve" command I get the blank page.
When I viewed the page source I found that ionic.css and ionic.bundle.js file are not loaded during ionic serve. And in the console I get the error like "angular is not defined". Can anyone please help me fix this?
Here is my index.html which should load css and js files
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/services.js"></script>
</head>
<body ng-app="starter">
<!--
The nav bar that will be updated as we navigate between views.
-->
<ion-nav-bar class="bar-stable">
<ion-nav-back-button>
</ion-nav-back-button>
</ion-nav-bar>
<!--
The views will be rendered in the <ion-nav-view> directive below
Templates are in the /templates folder (but you could also
have templates inline in this html file if you'd like).
-->
<ion-nav-view></ion-nav-view>
</body>
</html>
So it was not the issue with my ionic but with my browser. Turns out I was getting ERR_CONNECTION_RESET in my console. So basically what I did was
Open cmd prompt as administrator.
Run the command netsh winsock reset.
Restart my computer.
I don't know how it happened but it solved all my problems.

How to concatenates css files with .map files in sails?

I am a newbie in Nodejs,
When I try to use grunt in sails with 'sails www --prod' command.
My web's style is broken. Then changed css path,
<!--STYLES-->
<link rel="stylesheet" href="min/production.min.css">
<!--STYLES END-->
to
<!--STYLES-->
<link rel="stylesheet" href="concat/production.css">
<!--STYLES END-->
to find what happened, And in the browser console told an error
GET http://localhost:88/concat/bootstrap.css.map 404 (Not Found)
Now, I know that bootstrap.css can't find .map file and I didn't know how to fix it.
Thanks for help.
You should copy bootstrap.css.map from bootstrap folder to concat folder

Ionic serve results in a blank page

I've recently stumbled upon an annoying problem and can't figure out what could be the cause. I'm working on a ionic hybrid app and since yesterday everything worked fine: I was able to deploy it on my android phone, I could debug it on my browser. Today I open up my project, fire the ionic serve and the browser greets me with a blank screen.
I get the address: localhost:8100/, but it really should be localhost:8100/#/app/sessions
The console log report no errors neither the net log.
This is the source code of the index.html page:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/angular/angular.min.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/services.js"></script>
</head>
<body ng-app="starter">
<ion-nav-view></ion-nav-view>
</body>
</html>
I tried to start a new ionic project but the outcome is the same: I get a blank page.
I've set the ionic serve address to localhost; I,ve tried to load all angular and ionic module but to no avail. Do you have any suggestions?
On a closer inspection I found this error (I've skimmed the log):
"Error: [$injector:modulerr] Failed to instantiate module starter due to:
[$injector:modulerr] Failed to instantiate module starter.controllers due to:
[$injector:modulerr] Failed to instantiate module starter.services due to:
[$injector:modulerr] Failed to instantiate module ngResource due to:
**[$injector:nomod] Module 'ngResource' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.**
I wasn't really sure why but angular coudn't find the ngResource module. A quick check show me spelling wasn't the real problem.
For some reason (on whitch I'm still investigating) publishing the app destroyed angular-resource.js and the resulting .min was lacking the code.
Anyway, when I tried to reload the whole thing, I was loading ngResource version 1.3.15 and angular.js version 1.3.14, making them not working.
So, I was failing Computer Science 101: "always check the versions".
I've set all the version to 1.3.15 and all is working like a charm.
For what it is worth, we had a very similar problem: ionic serve -c had no negative behavior, no error output, simply loaded a blank screen.
The problem in our case was that there was a "!" in the full path of the working directory.
Changing the working directory to a path without a "!" solved this issue.
Original solution here

Include .js file in All Gsp file in STS (Eclipse) IDE?

is there any way to include a file in all gsp file header ? i want to include a file
<g:javascript src="hotkey.js"/>
in all Gsp files heade part. i'm using STS (SpringSource Tool Suite).
If you include your .js files in main.gsp then it will automatically be included in all gsps with the tag <meta name="layout" content="main" /> in the <head>. Example gsp head below:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<g:set var="entityName" value="${message(code: 'transactionRecord.label', default: 'TransactionRecord')}" />
<title><g:message code="default.create.label" args="[entityName]" /></title>
</head>
The main layout is automatically included in all gsps generated by the scaffolding create commands.