How do i use ossn_url or ossn_plugin_view within javascript to locate a file in my component

Moneya Posted in Component Development 8 years ago

Hi
I am trying to locate an html file used in my JavaScript directive for a component.
the file i am trying to locate, is located at component/mycomponent/plugin/default/pages/myfile.html

i tried this code below it isn't working.

// DIRECTIVES

mySearchApp.directive("frameList", function() {
    return {
        restrict: 'E',
        templateUrl: ossn_plugin_view('pages/frameList.html'),
        replace: true,
        scope: {
            frameItem: "=",
            frameFrameUrl: "@",
            selectframeFunction: "&"
        }

    }
});

note this javascript file has been added via

ossn_extend_view('js/opensource.socialnetwork', 'js/directives');

and it is working only the html file location is my problem.

Any help is appreciated.

This topic has been closed!

[Topic is Close]

Replies
ng Moneya Replied 8 years ago

Used this

   // DIRECTIVES
mySearchApp.directive("frameList", function() {
return {
restrict: 'E',
templateUrl: <?php echo ossn_site_url(); ?>components/component-name/plugins/default/pages/frameList.html',
replace: true,
scope: {
frameItem: "=",
frameFrameUrl: "@",
selectframeFunction: "&"
}

}
});
ng Moneya Replied 8 years ago

Problem Solved