This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import { Title, Meta } from '@angular/platform-browser'; | |
//An example of a component setting title and description tags | |
@Component({ | |
selector: 'app-about-me', | |
template: ` | |
<p>This page is about me!</p> | |
`, | |
styleUrls: ['./about-me.component.scss'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, Renderer2, Inject, ElementRef } from "@angular/core"; | |
import { ActivatedRoute } from "@angular/router"; | |
import { DOCUMENT } from "@angular/platform-browser"; | |
//This should be injected in the app component, and any component or service | |
//that is responsible for pagination | |
@Injectable() | |
export class PaginationService { | |
private totalPages: number; | |
private currentPageNumber: number; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Router } from '@angular/router'; | |
import { Component, OnInit } from '@angular/core'; | |
@Component({ | |
selector: 'app-bad-link', | |
template: ` | |
<p (click)="onSelfClick()"> | |
bad-link works! | |
</p> | |
`, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"gulp": "^3.9.1", | |
"gulp-batch": "^1.0.5", | |
"gulp-run": "^1.7.1", | |
"gulp-watch": "^4.3.11", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gulp = require('gulp'); | |
const run = require('gulp-run'); | |
const watch = require('gulp-watch'); | |
const batch = require('gulp-batch'); | |
gulp.task('deploytosf', () => { | |
console.log('Running SF deploy script!') | |
return run('ant localDevDeploy -f salesforce/build.xml -lib salesforce/lib').exec('', function(e) { | |
if (!(e && e.status)) { | |
console.log('Page deployed!'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Only added lines shown | |
parser.add_argument("--pagename", help="") | |
pageName = args.pagename | |
inAppPageRoot = 'apex/' + pageName | |
html = html.replace('$SFPAGEROOT', "'" + inAppPageRoot + "'") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<app-root></app-root> | |
<script> | |
<!-- only added lines shown --> | |
gSfPageRoot = ''; | |
if (typeof $SFPAGEROOT !== 'undefined') { | |
gSfPageRoot = $SFPAGEROOT; | |
} | |
function getSfPageRoot() { | |
return gSfPageRoot; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--The content below is only a placeholder and can be replaced.--> | |
<div style="text-align:center"> | |
<h1> | |
{{title}}! | |
</h1> | |
<img [src]="'assets/salesforce.png' | staticpath"> | |
</div> | |
<h2>Here are some links to help you start: </h2> | |
<ul> | |
<router-outlet></router-outlet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare var getSfStaticResourceRoot : () => string; | |
export function getStaticPathForResource(resourcePath : string) { | |
return getSfStaticResourceRoot() + resourcePath; | |
} | |
/* | |
* Ensures a static asset path gets the right prefix | |
*/ | |
@Pipe({name: 'staticpath'}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#only added lines shown | |
parser.add_argument("--assets", help="") | |
args = parser.parse_args() | |
assetsName = args.assets | |
html = html.replace('#RESOURCES#', assetsName) |