Forum Discussion

javagamer's avatar
8 years ago

Angular question

Hi,    I've created an Angular component on Lithium Blog Article pages and when I do this, other Lithium Angular features such as the photo gallery and the Profile Menu are not working. Please advi...
  • phani's avatar
    8 years ago

    Hi javagamer,

     

    Try following code.

     

    <div id="smartlingArticle" ng-controller="SmartlingArticleController" li-bindable>
    </div>
    <@liaAddScript>
    ;(function (angular) {
    /* Registering the app with Lithium Angualr App */
    var coreModuleDeps = LITHIUM.AngularSupport.getOptions().coreModuleDeps || [];
    coreModuleDeps.push('smartlingArticleApp');
    LITHIUM.AngularSupport.setOptions({ coreModuleDeps: coreModuleDeps });
    angular.module('smartlingArticleApp',[])
    .controller('SmartlingArticleController',function($scope){

    });
    })(LITHIUM.angular);
    </@liaAddScript>

     

    Hope this helps!

    Thanks,
    Phani