as continue learn how build sites in angular, 1 issue i'm having lot of trouble how view behave way based on controller.
i have site playing pen-and-paper rpgs via play-by-post. in php, have "character" class, has top level functions display. have other classes extend class, based on type of game, , classes extending those.
one example vast majority of rpgs have stats. in d20 based game, tend common set of six. in savage world games they're different. on display, php, have function called "displaystats", , does/shows different based on child class calls it. in angular, can think of doing having bunch of different directives different names, <stats-d20> or <stats-savage-worlds>, messy.
so, class, can have directive <stats> that'll call different based on different settings, other putting in bunch of if statements in link function? friend mentioned can assign controller directive, haven't quite figured out how that'd help?
in general, i'm not seeing how setup angular code in situation this. i'm not seeing how use techniques/methods learned through oop here (and i'm guessing they're not directly useful), , kinda annoying. here have great working oop code display stuff, , i'm struggling think of how without creating <really-complex-directive-names>. or have do? use non-pretty names, harkening days of multi-part variable names categorize?
Comments
Post a Comment