Running Angular2 In Subdirectory

To host in a sub directory with apache, you can just do this: Build command similar to this: ng build –base-href /myapp/ .htaccess file would look like this RewriteEngine On RewriteBase /myapp/ Options +FollowSymLinks RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.html [L,QSA]

How to use UMD in browser without any additional dependencies

Ok, so you are running in an environment without RequireJS, CommonJS, SystemJS, etc. The key line is factory((global.mymodule = global.mymodule || {})) this does a few things: If global.mymodule truthy, then it is equivalent to global.mymodule = global.mymodule // A noop. factory(global.mymodule) Otherwise it is equivalent to: global.mymodule = {} factory(global.mymodule) Inside the factory: Your … Read more

How to prepare release version with SystemJS and Gulp?

You will get ” Unexpected anonymous System.register call” because the references are not being loaded in the correct order. I use JSPM to properly build my angular app for production. There are 4 parts to the process. Part 1: Compile your typescript files var ts = require(“gulp-typescript”); var tsProject = ts.createProject(“./App/tsconfig.json”); gulp.task(“compile:ts”, function () { … Read more

SystemJS – moment is not a function

Simply remove the grouping (* as) from your import statement: import moment from ‘moment’; Without digging too deeply in to the source code, it looks like moment usually exports a function, that has all kinds of methods and other properties attached to it. By using * as, you’re effectively grabbing all those properties and attaching … Read more

Angular2 + Jspm.io : reflect-metadata shim is required when using class decorators

Yes, what you’re looking for is possible and works nicely. It appears as though you have the dependencies right. I think you are missing only the following, which needs to be at the beginning of your top level typescript or JavaScript file. Specifically, these need to be prior to the first line is that loads … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)