Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript Help with constants file

bootsy

Coder
I have a global constants file where I added a links node to it but I'm not sure how to translate that from the constants file into the html file or possibly ts file.

constants file


Code:
export const GlobalConstants = {
  AOApiPath:
  'api/uddi:schwab.com:service:sch.core.retirementPlanServices.AccountOverview/
   Dashboard/Hub',
  apiPathData: {
    "aoApiLandingPageContent": {
        "viewId": "landingpageview",
        "moduleId": "header",
    },
    "aoApiPersonalPerformance": {
        "participantId": "",
        "pId": "",
  },
  "aoApiRolloverOptions": {
    "viewId": "landingpageview",
    "moduleId": "EnrollmentSuccessCard",
  }
}, 
links: {
  classicAO: '../MicroUIs/'
}
}


Added public backToClassicAO() method, but I don't know if that is correct or on the right path

typescript

Code:
import { Store } from '@ngrx/store';
import { GlobalConstants } from 'src/app/ao-shared/global-
constants';

@Component({
 selector: 'app-personalperformance-enhanced-nonqual',
 templateUrl: './personalperformance-enhanced-
 nonqual.component.html',
 styleUrls: ['./personalperformance-enhanced-
 nonqual.component.scss'],
})
 export class PersonalperformanceEnhancedNonqualComponent extends
  AoLoadableComponent {

constructor(changeDetectorRef: ChangeDetectorRef, store: Store) {
  super(changeDetectorRef, store);
  this.store = store;
}

 ngOnInit() {
  super.ngOnInit();
  this.registerModalContent();
 }

public backToClassicAO(){
window.open(GlobalConstants.links.classicAO);
  }
}

For the html I want the link or href? to be for the words 'go back to the classic experience.'

html



HTML:
 <div class="sdps-is-relative badge-example-outline sdps-p-around_medium sdps-m-
   around_medium">
  <sdps-badge
     sdps-id="spdb-promotional-beta-overlay"
     type="promotional"
     status-text="Beta"
     promotional-type="beta"
     sr-label-prefix="You have got"
     sr-label-suffix="notifications"
     is-overlay
  >
  </sdps-badge>
   <div class="ao-text-header">Account Overview has a new look</div>
  You can view your retirement accounts below, or go back to the classic experience.
 </div>

To summarize, I'm trying to get the constants file to connect or translate to the html to create a link for around those words. My terminology my be off and if so I apologize. Tried to the best I can to explain. I would definitely appreciate any assistance. Thanks
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom